Technically the INS deems one out of status the day employment was terminated.
In practice, if there is a time gap between filing for the H-1 transfer with the new company, and the last date of employment with the old company, at the INS' discretion, the new H-1 is approved, in most cases without an I-94. This requires the H-1 holder to make a trip outside the U.S and come back with a new I-94 at POE to begin work. (also need to get a new visa if old visa has expired).
The exact time period is anybody's guess, but uder no circumstances should the the out-of-status period be > 180 days, since one is subjected to 3/10 year bars to entrys after that point
It is best to find another employer and have an H-1 filed (with receipt) BEFORE your current employer lays you off. You can begin work with the new employer once you have your H-1 receipt notice.