You are mistaking visa with status! come in
the expriation date on visa only means by that date you need to enter US. The time you can stay in US is determined by the date on your I-94, and it is determined by officers at the port when you enter US.
If you transfer status in US, say F1-H1B, your legal period to stay in US is on the I-94 which is attached to the bottom of I-797, the approval notice. So in the end how long you can stay is determined by the date on I-94, and nothing else. Dig your forms out, and check carefully. If you think the port officer made a mistake, go to local USCIS office ASAP and correct it.
Hope it is not this bad.