A US Visa can be allowed to expire at any time during the stay. A visa is only relevant when making an application for entry. It grants you no rights whatsoever other than the priviledge of make an application for entry at a POE.
The determining factor in this case is whether the alien remains IN STATUS throughout their physical presence in the USA. Status is granted by the inspector at the POE and is usually annotated on the I-94 form (for most statuses including the most common B1/B2 status). A visa can be still valid while the alien is out of status and status can be still valid while a visa has long expired.