Why?
People like to work in Thailand. Going around from Office to Office and many times abroad to get the Non Immigrant B Visa. Than visit Ministry of Labor to collect their Work Permit and visit with lots of papers Immigration for the Extension of Stay based on working. Yeah, all in the bag so we can work legally.
But than, for what ever reason work stops. Okay, we just leave to do a border run or fly out for a new tourist visa, who cares about the WP and the Extension of Stay.
Several posts been posted in the last few months of people who got refused to leave Thailand, people who got problems to re-enter Thailand and people got fined overstay from the day they stopped working till the day they went to Immigration to apply for a new Extension of Stay.
If you stop working, for what ever reason, the Work Permit is yours, so YOU have to make sure it get cancelled on the day YOU stop working, same as you started working when you picked up the work permit.
The Extension of Stay is in YOUR passport, and YOU are responsible for YOUR passport. After cancelling your Work Permit you visit Immigration and cancel your Extension of Stay. This was based on working and you don't work anymore.
Take care, you don't want being denied exit at a border somewhere on your last day of stay, you don't want denied entry stamps in your passport. And for sure you don't want to face all the problems for travels to other destinations to solve the problem of just ignoring the rules.
Edited: As well as at Ministry of Labor and Immigration Office you signed a form that you understand the rules.
TLDR : Answer Summary
When you stop working in Thailand, it is crucial to cancel your Work Permit and the Extension of Stay related to your employment. Failure to do so can lead to issues like fines for overstaying or being denied re-entry into Thailand. You are responsible for your visa status and must take proactive steps, including visiting the Ministry of Labor and Immigration to sort out your work permit and visa extensions, respectively. If you need a break between jobs, consider canceling your work permit and extension, then applying for a tourist visa to re-enter the country.