@Aleksandr ********
if you are on an extension based on employment or education and leave with it canceling it officially at the immigration office, you just stamp out, but that doesn't cancel an extension.
If/when you come back and go to get a new long term extension immigrations will see the "open" (uncanceled) extension and fine you (up to a max of 20k baht).. before they will get you get the new extension.