With recent layoffs in the tech industry, H-1B and other nonimmigrant workers may find themselves stranded in the US with no work and potentially no legal immigration status.  USCIS has issued detailed information for these workers, explaining their options and some relief that may be available in certain circumstanes:

60-Day Grace Period:  Regulations permit a discretionary grace period that allows workers in E-1, E-2, E-3, H-1B, H-1B1, L-1, O-1, or TN classifications (and their dependents) to be considered as having maintained status following the cessation of employment for up to 60 consecutive calendar days or until the end of the authorized validity period, whichever is shorter.  During this period, workers may be able to maintain their nonimmigrant status if a new employer timely files a petition on their behalf with an extension of stay request (e.g., an H-1B change of employer petition for a worker in H-1B status).

Portability:  Portability rules permit workers currently in H-1B status to begin working for a new employer as soon as the employer properly files a new H-1B petition with USCIS, without waiting for the petition to be approved.  Also, a worker with an adjustment of status application (Form I-485) that has been pending for at least 180 days with an underlying valid immigrant visa petition (Form I-140) has the ability to transfer the underlying immigrant visa petition to a new offer of employment in the same or similar occupational classification with the same or a new employer.

Change of Status and/or Employer: Workers may use the up to 60-day discretionary grace period to apply to change their nonimmigrant status, which may include changing status to become the dependent of a spouse (e.g., H-4, L-2). Some individuals in a dependent nonimmigrant status may be eligible for employment authorization incident to status, including spouses of E-1, E-2, E-3, or L-1 nonimmigrants.

There are other options available as well, depending upon individual circumstances. It is highly advisable for anyone who finds themself terminated from the employment that is underlying their nonimmigrant visa status to contact immigration counsel to review all of the legal options, and  immigration consequences of the termination.