The sooner you can have the new employer file a new petition on your behalf, the better the chances that the petition will be approved as a change of status within the US and not as consular processing.  LEgally and technically, you are out of status as soon as you are no longer employed; however, if your I-94 is still valid, you are not unlawfully present in the US.  As  soon as you are out of status, it is no longer legally possible to do a change of status since you must be IN status in order to CHANGE status.  However, practically speaking, as long as the new employer files a petition on your behalf soon enough that your most recent paycheck stub is still current enough, it has a good chance of being approved as a change of status.