score:2
There is no correlation between the duration of stay in the US and validity of the visa. Those are completely different things handled by different departments. Immigrant visas (for permanent residence in the US) are usually only valid for 6 months. The ratio between stay validity and visa validity here is infinite.
A US visa is a document issued by the State Department which allows you to travel to the US and request to enter the US at a port of entry. Your stay inside the US is covered by DHS (Deparment of Homeland Security). Your H1B petition was approved by USCIS (part of DHS). You visa (issued by State Department) only pertains to your travel, not your stay inside the US.
Validity of the visa is based on reciprocity agreement between the US and your country of citizenship. Some countries get H1B visas valid for 6 years, but the petitions are approved for 3 years for everyone.
Imagine I invite you to my house for overnight stay from 8 PM to 8 AM. That is your H1B petition. But I tell you that you can knock at my door from 8 AM until 11 PM and give you a note for my doorkeeper. That is the visa. You can knock at 8 PM, my doorkeeper will open the door and admit you. If you want to go out for a cigarette at 10 PM, you can go out, and then again ask the doorkeeper to open the door as long as it is before 11 PM. But if you go out after 11 PM, my doorkeeper will not open the door. You will have to ask me again for a new note to be allowed to request entry.
So you can use the visa to travel to the US for the validity of the visa. If you leave the US, to comeback, you should have a valid visa. If your visa is expired, you will need a new visa to come back.
So a US visa only relates to your travel, not to your lagality in the US.