You may stay legally in the United States as long as you are a full time student. BIR has a maximum 28 month length of study, which means that you can stay legally in the U.S. for 28 months even if the expiration date on your F-1
visa or study completion date on your original Form I-20 has expired. However, your F-1 needs to be issued for "Duration of Status" (abbreviated in your passport, Form I-94, Form I-20 card as "D/S"). At the time when your F-1
Visa is extended beyond the original expiration date, you should obtain a new Form I-20 with the new expiration date from your school's DSO. This will help you keep track of your new expiration date and insure that your information
is properly updated in the SEVIS database. However, if you depart the U.S. with an expired visa page in your passport, or without an F-1 visa page (in case you changed status to F-1 while in the U.S.) you will need to obtain
a new F-1 Visa before returning to America and resuming your studies. A student visa to enter the U.S. can be issued only at an Embassy or Consulate abroad.