Foreign employees resigning or being dismissed must have their Work Permits cancelled at the Labor Department within 7 days from the last working day.
The foreigner or the company must file one of the following cancellations: notifying the last official day under a Work Permit, canceling a Pre-Work Permit Approval (PWPA) application, or canceling a Work Permit application. After this they have to wait 15 days before filing another application.

In the case of changing the sponsorship (COS), if the Work Permit holder is able to obtain a new Work Permit and Visa on the same day that the previous Work Permits is cancelled, then the 15 days requirement will not apply.
If the foreigner will be transferred to an affiliate company, the application for a new Work Permit and Visa can be made 15 days before the last working.

In all other cases, once the Work Permit is cancelled, the Visa is also cancelled. In order to apply for a new Work Permit, the foreigner must to leave Thailand and apply for a new Visa.