The visa validity is the length of time between the visa issuance date and the visa expiration date. Visa validity is determined by the visa type and by the consular officer who issued the visa. It is the period of time you are allowed to travel to a U.S. Port of Entry, not the amount of time you are allowed to stay in the U.S.
Having a U.S. visa means that you're eligible to travel to a U.S. port-of-entry for a specific purpose. Once you arrive at a U.S. port-of-entry, a U.S. immigration officer will decide whether to allow you to enter and how long you may stay. If you are given permission to enter the country, the immigration officer will either stamp your passport with an admission stamp or give you a paper Form I-94 which marks the amount of time you are allowed to stay in the U.S. If the stamp or Form I-94 has a specific date, this is the date you must leave the U.S. If the stamp or Form I-94 is marked "D/S" (duration of status), then you may remain in the U.S. as long as you continue your course of study, remain in your exchange program or remain employed. The date you are admitted into the country and the date your status expires will be entered into an electronic system by the immigration officer (this electronic method was recently started in 2013 for travelers entering via air or sea).
For further explanation, please read this example scenario:
Rosa is visiting the U.S. from Argentina on a B-2 visa that is valid for four years. This means that during that four-year period, Rosa has permission to travel to a U.S. Port of Entry (i.e. U.S. customs at the airport, border patrol stop if going via car, or seaport) and ask for admission into the U.S. The visa validity only denotes Rosa's permission to travel to the U.S., not how long she is allowed to stay in the U.S. during each trip.
At the U.S. Port of Entry, An immigration official will decide whether to allow Rosa to enter and how long she will be allowed to stay in the U.S. during that particular visit. The length of stay is usually shown by a passport stamp, which has an "expiration date". The expiration date is the date Rosa's permission to stay expires and the date she must leave the U.S. The date Rosa was admitted into the country and the date her status expires (known as the arrival/departure record) will be entered into an electronic system by the immigration official (this electronic method was recently started in 2013 for travelers entering via air or sea).
Regardless of the four-year validity of Rosa's B-2 visa, she must leave the U.S. no later than the expiration date given to her at the U.S. Port of Entry (unless she applies for an extension of stay). If Rosa wants to come back and visit the U.S. at a later time during those four years, she does not have to apply for a new visa just go to the Port of Entry and request entry.