I am often asked whether workers on H-1B or L-1 status can be terminated even if their visas have not expired. Others have asked me questions like how long can an H-1B employee stay in the US after being terminated, whether there is a grace period like 30 or 90 days. The answer is simple and draconian: once the employer-employee relationship ends, so does the employee's immigration status. In other words, when an employee no longer provides services as per the terms of their work petition, they are no longer allowed by the USCIS to stay in the US.
In practical terms, this does not mean that a worker who is laid-off or terminated employee packs their belongings, uproots their families and heads straight to the airport after they receive notice of their termination to return to their homelands. However, each day that they stay beyond their last day of work is a day that would be considered unauthorized by the USCIS. An unauthorized stay however, is different than time spent in unlawful presence, which is a legal term of art. Obviously, neither unauthorized stay nor time spent in unlawful presence is something any worker wants to face, especially if one hopes to return to the US in the future to provide services to a new employer. The consequences of any overstay can ruin your chances at immigrating to the U.S. in the future. It can also affect your ability to visit or even work again on H-1B or any other status in the future.
If you have been laid off or fired from your job, or if your company has announced imminent layoffs, you need to seek the counsel and advice of an immigration visa attorney who can help you understand your rights and obligations you face as a temporary foreign worker in the U.S. If you have the luxury of time, to look for another job before you are laid off, you also need to talk to an attorney who can give you the facts about how to change employers or "transfer" your H-1B to a new employer so that your risk even a day of being out of status.