The vast majority of immigrants to the United States must have the process started for them, by a family relation or an employer that files a visa petition on the immigrant's behalf. (This is sometimes, but not entirely accurately, referred to as being sponsored.) The person or company that files the petition is called the "petitioner" and the intending immigrant is the "beneficiary." But what if either the petitioner or the beneficiary has a change of mind or the employer no longer needs the employee? It is possible to cancel a visa petition.
To understand whether and how the petitioner or beneficiary can back out, you first have to understand a bit about the visa petition process. The visa petition must normally be filed with U.S. Citzienship and Immigration Services (USCIS), using either Form I-130 (for family immigration cases) or I-140 (for employment-based immigration cases).
After the petition is approved, the immigrant, with the help of the petitioner, is brought into the process and files an application for an immigrant visa (if coming from outside the United States) or for adjustment of status (if already in the United States and eligible to use the adjustment of status procedure).
If the visa petition has not yet been approved, it's relatively easy to cancel it. All you need to do is send a letter to USCIS, at whichever office is currently handling the petition, informing it of your decision. Enclose a copy of the receipt notice, if you received one from USCIS. That will help it trace your file.
If the visa petition has been approved but the immigrant visa or green card has not yet been issued, you'll need to figure out which office is handling the case and send your request to withdraw to that office. In fact, they'd like you to state the reason for the withdrawal, mainly because if one party is alleging fraud by the other one, USCIS wants to note that for its records.
If, for example, the petition has been approved and the immigrant is awaiting a visa interview at an overseas consulate, the most likely office to be handling the case is the National Visa Center – see its procedures at http://travel.state.gov/content/visas/english/immigrate/nvc/immigrant-processing-faqs.html.
If the immigrant visa or green card has been issued, it's much harder for a petitioner to withdraw support and ask that the green card be cancelled. By this time, the immigrant is considered to have acquired U.S. status in his or her own name, and a petitioner would most likely have to allege fraud to have that status revoked (taken away). You'd want to consult a lawyer who can analyze the situation based on the type of visa at issue and the surrounding circumstances.
Also note that, by this point in the process, all family petitioners have signed an "Affidavit of Support," promising to financially support the immigrant for approximately ten years after he or she gets the green card or until the beneficiary becomes a U.S. citizen, dies, or has the green card revoked. This obligation survives regardless of a divorce.