If you are terminated there is no grace period. You may also find a new employer within 60 days getting laid off and file an H1-B transfer provided you have a valid I-94 and has not entered into any unauthorized employment. However, USCIS may not approve the new H1B petition with an I-94 attached to it. If you cannot find another employer, it is better for you to change your status to B1/B2 and find a new job. Then change back to H1B once a new employer has a job for you and files the petition.