There is no grace period but you may have options based on your specific circumstances which you would need to discuss with an attorney.
Attorney Jennifer Ahn's answer is to provide general information only, and should not be construed as legal advice on any subject matter. The content of this answer is not intended to substitute accurate legal advice, which is relevant to all the facts and circumstances of your specific case. This answer does not create an Attorney-Client relationship.
I assume that you actually did not get a green card through company B, but merely approval of an I-140 petition, and you are now on a priority wait list. Your present and future employer would not be able to use an approved petition by another former employer to allow you to apply for adjustment of status. And if you are terminated by company C, you have only 30 days to settle your affairs and leave without getting classified as "out of status."
All answers to immigration questions should not be taken as legally binding advice. If you have an immigration issue, please call me at Pacifica Legal Services 805-290-4930 and make an appointment for an initial 30 minute consultation. Additional time is billed at $100.00 per 30 minute increments. Todas las respuestas a las preguntas de inmigración no deben tomarse como asesoramiento legal. Si usted tiene un problema de inmigración, por favor llámeme al Pacifica Legal Services 805-290-4930 y hacer una cita para una consulta inicial de 30 minutos. El tiempo adicional se factura a $ 100.00 por incrementos de 30 minutos.