Once you're in the United States on a student visa (F-1 or M-1), your right to stay in the country depends not only on when your official permission to remain 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 the rules that come with your F-1 or M-1 student visa, you are said to "fall out of status." That means 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 United States would be entered onto your permanent immigration record.
The most important rules are rather simple. You must, in order to comply with the terms of a student visa:
Many students break these rules and lose their student status, either by reducing their course load below full-time study (or just dropping out altogether), taking a job off-campus without permission, or switching schools or programs without advising the right people (your DSO or USCIS).
You'll also be violating your status if you lie or give false information to USCIS or are convicted of a crime of violence.
Unfortunately, one violation tends to cause another. For example, if your expected completion date as shown on your Form I-20 passes and you don't notice, and you continue working at your on-campus job, you will technically be working without authorization—on top of having overstayed your student status. In fact, any employment becomes unauthorized as soon as you fall out of student status. This compounding of violations can create problems because different violations can have different legal consequences.
One positive bit of news: Staying beyond the expiration date shown on your original F-1 visa is not a status violation. Your student visa, unlike your I-20, is mainly an entry document. So the expiration date there shows the last date you can use it to enter the United States, not the date by which you have to leave the United States. But if you do leave the United States with an expired visa, you will have to renew the visa at a U.S. consulate before returning.
When in doubt about whether something you are planning to do will be a violation of your visa or student status, talk to your school's DSO. It is especially important to talk issues over with the DSO before you take action, because once you have violated your status, the DSO must report you to USCIS.
USCIS does not expect you to drag yourself to school if you come down with a serious illness or become pregnant. If something of a medical nature happens, talk to your DSO so that they understand the situation and don't report your absence from school to USCIS.
As soon as you are fully recovered, you are expected to resume a full-time course load. If your illness prevents you from completing your studies by the date on your I-20, you'll need to apply for an extension of time. Again, talk to your DSO.
Most foreign students don't have to worry about school vacations or exams breaking their status. For F-1 students, as long as your course of study extends into the next school term, scheduled school vacations spent in the U.S. (summer included) are not considered to break your full-time course of study or to violate your visa status.
F-1 students whose school follows a quarter or a trimester calendar can shift their summer vacation to another season, so long as they study for a whole academic year first. Exam periods (when the school gives you a couple of weeks off from classes to study for exams) are similarly not considered to break your F-1 status.
If you are an M-1 student, exam periods and short vacations will not break your status. However, M-1 students are eligible for a summer vacation only if you have completed an academic year prior to that summer and are eligible and intend to register at the same school after the summer vacation. In addition, you'll maintain your status while taking a vacation only if vocational students at your school normally take a summer vacation. If, for example, your vocational program is only 12 weeks long, it is unlikely to include a summer vacation.
The consequences of violating the terms of your student status depend on what exactly you do and who finds out about it. A minor violation, such as babysitting one night for cash, might go unnoticed and/or result in nothing. But don't take this example as permission to go out and try it!
In fact, unauthorized employment is the worst sort of status violation, because it is the only one that you cannot overcome by applying to be returned to student status, through a process called reinstatement.
If USCIS catches you in a status violation, it could place you and your spouse and children in removal proceedings in immigration court. If you don't have a defense, you could be deported, which leads to a bar on returning to the U.S. for several years. (See Can You Return to the U.S. After Being Deported?.)
On top of this, even if you avoid deportation, the judge will likely find that your violation caused some of your time in the United States to be "unlawful." Once your "unlawful presence" has added up to six months or more, the first time you leave the United States you could find yourself prevented from reentering for three years. With unlawful presence of one year, you'd be barred from returning to the U.S. for ten years.
To avoid such consequences described above, you might want to step up and apply for "reinstatement." Don't wait until you're caught in a violation, or the application will most likely be denied. If your request for reinstatement is approved, USCIS will officially recognize that you have gotten back your student status (and are no longer accruing unlawful time) as of the date it reinstates you. How to apply is described in the article Reinstating Your F-1 Student Status.
If you have any questions about your status or reinstatement that your DSO cannot answer (or that you don't want to bring up with him or her), consult an experienced immigration attorney.