The short answer is: It depends. There are legal ways to switch from one visa status to another with a gap in between, but only if you make sure that you never let one visa lapse without having another one in the works. We'll look closer at how to do that within this article.
As the holder of a nonimmigrant (temporary) visa, you probably know that your permitted stay in the U.S. will expire at some point. That expiration date is most likely specified on your Form I-94 Arrival/Departure Record. (F-1 student visa holders are an exception, however; their visa usually says "D/S" for duration of status, meaning they can stay in the U.S. until the completion of their studies and any authorized employment, known as Optional Practical Training, following graduation.)
When you reach the end of your permitted U.S. stay, plus any "grace period" that might be allowed under your visa, you are expected to leave immediately. You no longer have lawful status.
In many cases, even though your visa stamp in your passport, which you received from the U.S. consulate or embassy abroad, still may be valid on its face, it can become automatically void. At this point, unless there are compelling circumstances beyond your control or another exception, it is too late to think about taking any action to obtain a new legal status in the United States. Even if you qualify for it, the fact that your status has expired means that you cannot stay in the U.S. to apply for it. In order to avoid this result, plan ahead and take action to extend or change your status (as described below) BEFORE your expiration date arrives.
Some notable exceptions to the above rule apply. For example, if you entered the U.S. on a visa and later decide to marry a U.S. citizen, you can apply for a green card (adjustment of status) even after your expiration date, without having to leave the United States first. Realize, however, that your stay will be unlawful up until the day you turn in your adjustment of status application, which means you are at risk of being caught and placed into removal proceedings.
Another important exception applies to people who have faced persecution in their home country, or fear they would be persecuted upon return. They may apply for asylum even if their visa has run out. However, they are expected to do so either within one year of U.S. entry or one year of their expiration date, depending on current policy. For the eligibility rules, see Who Is Eligible for Asylum or Refugee Protection in The U.S.?
If you act in a timely manner, you might be able to get an extension of status under your current visa (or change your status to another one, described farther below).
Most U.S. visas allow at least one extension. However, certain entrants cannot extend their stay under any circumstance, including those who entered:
If you hold any other type of visa, you will need to look into the length of the possible extension and whether there is a maximum set on the number of years you can spend in the U.S. on that visa. For example, if you entered the U.S. on a B visa (a visitor for business or pleasure), you can extend you stay for up to six months, for a maximum stay of one year. Holders of work-based visas can usually extend their stays even longer.
Once you submit your application for an extension of status, you are permitted to remain in the U.S. until you receive a decision from U.S. Citizenship and Immigration Services (USCIS)—even if your permitted stay expires while USCIS is considering your application.
If you qualify for another type of visa than the one you are currently on, or for a U.S. green card (lawful permanent residence), you will likely be able to apply for it without leaving the United States. You would do so through either a change of status or an adjustment of status application.
Again, however, you will need to submit your application before your permitted stay under your old visa runs out (subject to exceptions, such as for marriage to a U.S. citizen and applying for asylum, as described above).
To change status, you fill out the same form as you would for an extension; Form I-539. See Applying for an Extension of a U.S. Visa or Change of Status for details. Note that if you’re changing to a work visa, your employer will submit an I-129 petition to sponsor you for work authorization and change your status.
If eligible to change from a B visa visitor to an F-1 student visa, keep in mind that you might need to extend your B-1 visa before or concurrently with your F-1 change of status application. That means two separate applications. This is a complex area of the law, so be sure to consult an immigration lawyer for help.