After having been granted an F-1 or M-1 student visa, and actually entered the United States, you can stay and pursue your studies until the expiration date shown on your I-94. That may be a paper card that you received from the border officer at the U.S. airport, border, or other port of entry. However, if you entered the U.S. after April 2013, you may not have received an actual Form I-94; the sytem was "automated," and the paper cards phased out. If so, you can access this information online from U.S. Customs & Border Protection (CBP).
The exception is, however, if you violate the terms of your F-1 or M-1 visa. In that case, you will be expected to leave right away.
For M-1 students, the date by which the I-94 says they must leave is usually one year from when they entered the United States.
For F-1 students it’s a little more complicated. Their I-94s usually say “D/S” for “Duration of Status.” If your I-94 has this notation, the date you complete your academic program, plus a 60-day grace period, will be when you are supposed to leave. Always remember that the program end date on your I-20 form is just an estimate. If you finish your program earlier than that date, your grace period will also begin earlier.
The only time you can stay longer as an F-1 is if you apply for optional practical training (OPT) or file a change of status application before the end of your grace period. If you are approved for OPT, you will be allowed to stay until the end date on your employment authorization document, plus a new 60-day grace period.
If you are approved for a different status, you will receive a new Form I-94 with a new date telling you when you need to leave.
(Note: The original visa stamp in your passport that you received at the consulate may have an earlier or later expiration date on it. This date, however, does not determine when you should leave the United States, only how long you can use that visa to enter the country.)
If you find that you need or want more time to complete your studies, you may be able to apply for an extension.
If you stay in the U.S. beyond the date when your studies are completed, the first consequence is that you lose your eligibility to change, extend, or adjust your status by applying directly to U.S. Citizenship and Immigration Services (USCIS). If, for example, you were to receive a U.S. job offer, you would need to leave the U.S. and visit a U.S. consulate in order to apply for a nonimmigrant visa or green card based upon it.
At the consulate, or upon any future attempt to return to the U.S., you would potentially face a hurdle to returning to the U.S. if you had already spent more than 180 days there. unlawfully, as described in Consequences of Unlawful Presence in the U.S.: Three- and Ten-Year Time Bars.
Another consequence of overstaying your status is that you must, from that point onward, go to the U.S. consulate in your home country in order to obtain any sort of U.S. visa, rather than being able to utilize the services of a U.S. consulate in another country (called “third country processing”).
Once in the United States, your right to stay depends not only on when your stay expires, but whether you are maintaining your student immigration status. You can maintain your status by following all of the rules of your student status; in other words, by doing everything you agreed to do when you received the visa or status change.
If you violate these rules, you are said to “fall out of status,” meaning that your right to be in the United States disappears automatically. Your accompanying spouse and children will simultaneously lose their right to be here. You and your family could be deported and your unlawful stay in the U.S. entered onto your permanent immigration records.
The most important rules are rather simple. You must:
It's much easier to take steps to maintain status than to attempt to reinstate your status after a violation.