When you enter the United States on a student visa, you will usually be admitted for the duration of your student status. That means you may stay as long as you are a full time student, even if the F-1 visa in your passport expires while you are in America. An F-1 student who has completed the course of studies shown on the I-20, and any authorized practical training, is allowed to stay in the U.S. an additional 60 days before departure, in order to prepare for the departure or to transfer to another school.
As an example regarding duration of status, if you have a visa that is valid for five years that will expire on January 1, 2014, and you are admitted into the U.S. for the duration of your studies (often abbreviated in your passport or on your I-94 card as "D/S"), you may stay in the U.S. as long as you are a full time student. Even if January 1, 2014 passes and your visa expires while in America, you will still be in legal student status. However, if you depart the U.S. with an expired visa, you will need to obtain a new one before being able to return to America and resume your studies. A student visa cannot be renewed or re-issued in the United States; it must be done at an Embassy or Consulate abroad.