Travel before visa expiry H1B

My H1B visa is expiring on 03/jan/2018, I want to know how many days before your visa expires you are allowed to travel to usa.

I have been stamped, premium amendment is in progress, for which the result will come by 15-Nov-2017

I just want to know that how many days before you are allowed to travel.