The visa stamp is entered into your passport at the U.S. Consulate or Embassy where you applied for your student visa. It does not govern your stay; it governs the time period during which you may apply for entry into the U.S. Accordingly, your visa may expire while you are in the U.S. as long as all of you are maintaining status and your other immigration documents (passport, I-94 card marked D/S, and I-20 or DS-2019) are valid.
If your visa is expired and you travel beyond Canada, Mexico, and the adjacent islands and/or are not eligible for automatic visa revalidation, you must obtain a new valid visa to re-enter the U.S.
The Department of State recommends that you apply for a visa in your home country. For more information about visa applications visit the Department of State website.
Renewing Your Visa
A visa applicant should apply for a U.S. visa "at a consular office having jurisdiction over the alien's place of residence."
Though it is not often recommended, the regulations allow non-immigrants to apply for a U.S. visa in a country the applicant is not a resident of if that consular office has agreed to process visa applications from "third country nationals." Please note however, obtaining a student visa at a U.S. consulate outside your home country can be more difficult or time consuming as it consular officers in the country of an applicant's residence are in a better position to evaluate the applicant's ties to that country. If your visa application is denied, you will not be able to return to the United States; you will have to travel to your home country and obtain a new visa in order to be eligible to seek re-entry. Be sure to check the Department of State website for specific information pertaining to each consulate.
You will not be able to return to the United States until your new visa has been issued. In some cases, this could take several weeks if a background check is required.
Entry to the U.S. and School Noted on the Visa
For initial entry in F-1 status only, Customs and Border Protection must be satisfied that the student seeking admission to the U.S. intends to attend the school specified on the student's F-1 visa or for Canadian citizens, that the student intends to attend the school that issued the I-20 being presented at the port-of-entry.
For a student who has been in F-1 student status in the U.S., but traveled outside the U.S. for less than five months and has transferred or intends to transfer to a new school upon re-entering the U.S., the name of the new school does not need to be indicated on the visa.