@An***
a work permit doesn't let you stay in thailand it lets you work here. The visa or an extension lets you stay here.
IF you're on the initial 90 days of a Non-B visa you can stay until the stamp runs out
BUT
If you're on an extension of stay (from the immigration office) you need to go cancel your work permit, and then cancel your extension and leave the country.