If you plan to travel to a country that is contiguous* to the U.S. (but NOT Cuba) and you intend to stay there less than 30 days and will NOT apply for a new U.S. visa, you may reenter the U.S. on an expired visa stamp (this regulation is known as Automatic Visa Revalidation).
When traveling to a contiguous country, you keep the same I-94 number with you upon exiting the U.S. Tell the immigration official at the port of exit (border) that you intend to stay outside the U.S. for less than 30 days and that your U.S. visa is expired. Make sure to have your I-20 or DS-2019 signed by an immigration advisor at ISSS before you travel and present that document along with your valid passport, form I-94, and expired visa to reenter the U.S. Reentry into the United States through Automatic Visa Revalidation is not guaranteed.
If you are staying for more than 30 days or planning to apply for a U.S. visa while in Mexico or Canada, please talk to an international student advisor at ISSS before you make arrangements. In general, ISSS does not recommend that third-country nationals apply for a U.S. visa in Mexico or Canada because of lengthy delays due to background/security checks and complications in case of visa denial. If your visa application is denied, you would need to depart directly to your home country to apply for a new visa to reenter the U.S. You may not use Automatic Visa Revalidation if you applied for a visa while abroad.
Note: Citizens of Iran, Syria, Sudan, and those from a State Sponsor of Terrorism designated country as listed by the U.S. Department of State will not be allowed to reenter the U.S. with an expired U.S. visa stamp, even if the trip is to a contiguous country.
* Saint Pierre, Miquelon, Cuba, the Dominican Republic, Haiti, Bermuda, the Bahamas, Barbados, Jamaica, The Windward and Leeward Islands, Trinidad, Martinique, or other British, French or Netherlands territories or possessions in, or bordering, the Caribbean Sea.