Any immigrant who entered the U.S. on some sort of temporary visa and then submitted a green card application (for U.S. lawful permanent or conditional residence) is allowed to remain in the United States while the application is "pending." In other words, they can wait until their application has been decided upon by U.S. Citizenship and Immigration Services (USCIS). However, the key is to understand whether or not you really have a pending green card application.
Many people get this wrong and spend time in the U.S. unlawfully, for which there are severe penalties under the U.S. immigration laws. Merely having an approved visa petition, for example, is not enough, as further discussed below.
Let's start with what does NOT constitute a pending green card application.
If your family member or employer has merely started the process off for you, by filing what's known as a petition (typically on USCIS Form I-130 or I-140), that's not enough. A pending or approved petition from a U.S. sponsor gives you no rights to come to or remain in the United States. It only serves for the petitioner/sponsor to prove that the family or employment relationship exists between you and say, in effect, "I wish to sponsor this person." There's much more ahead to the application process!
(The exception would be if this application was filed concurrently with an Adjustment of Status application to USCIS, described below.)
Depending on the green card category you'll be applying in, you could be facing a wait of several years between the time your visa petition was filed with USCIS and when a visa becomes available to you. Again, you'd need some separate immigration status (such as a student visa) in order to legally stay in the U.S. during this wait.
If you were to spend the wait living in the U.S. unlawfully, you could ruin your chances of getting a green card anytime soon (as discussed in the next section). In the meantime, you risk being caught by the Department of Homeland Security (DHS) and placed into deportation proceedings.
Only when you yourself, as the immigrant, have filled out forms in your own name in order to apply for lawful permanent residence, can you be said to have a pending green card application. For many people, that requires filling out forms provided by a U.S. consulate in their home country and, even if they're in the United States, leaving in order to attend their immigrant visa interview there.
A few lucky people are allowed to stay in the United States and apply for their green card here, using a procedure called adjustment of status (AOS). You'd know you've applied for AOS if the primary form you filled out was an I-485. After submitting the AOS application packet, you'll normally receive a work permit (employment authorization or EAD), allowing you to not only live in the United States but accept employment here. You're likely to wait several months until your adjustment interview, at which your application for a green card will be approved or denied.
To further add to the confusion, there are a few categories of people who, if they manage to stay in the U.S. illegally without getting caught, can apply for adjustment of status here. Many people have done this while either waiting to finish preparing their AOS application or while waiting for a visa to become available to them (otherwise known as waiting for your priority date; the date on which your visa petition was first filed; to become current).
People who can apply to adjust status even after living in the U.S. without valid visa status include some who qualify under a very old law called Section 245(i), as well as immediate relatives of U.S. citizens who entered the U.S. legally. (Immediate relatives include spouses, parents, and unmarried children under the age of 21.) In fact, if such people have already stayed in the U.S. unlawfully for several months, they're better off trying to stay around and adjust status rather than leaving the U.S. for consular processing, because it's only during consular processing that an immigrant can be penalized for an overstay by being prevented from returning to the U.S. for a period of years.
But don't attempt to analyze whether you might fit into one of these categories on your own. As you can see, this is a highly complicated area of immigration law, and it's full of exceptions and traps. To read more about this issue, see, Can I Apply for a Green Card If I'm in the U.S. on an Expired Visa?
If you are in the United States on a visa or similar status and are in danger of your permitted stay expiring before you apply for your green card, consult an immigration attorney immediately.
Your attorney can analyze your rights based on your visa history and your green card application category, and can explain the benefits and risks of either remaining in or leaving the United States for the remainder of your green card application process.