There is no grace period for the case that you mentioned. In other words you start to accrue unlawful presence the day after you get laid off. The good thing is that USCIS has little chance of discovering that a person has been laid off unless a sponsor employer withdraws H1-B sponsorship.
Nevertheless one should make sure that his unlawful presence or un-authorized employment stays within 180 days as that that way he wouldn't incur any entry ban or ineligibility for I-485 application in the future (person is protected under I-245(k) if accumulated unlawful presence or un-authorized employment is less then 180 days).
Hope that this helps.