@And****
you get a letter from your school stating your course has ended and go to immigration in country who cancel your extension. I believe there are then three options:
(1) your letter was post-dated, in which case the cancellation is in the future and you leave by that date
(2) your letter was not post-dated, in which case your cancellation is immediate and you have to leave same day
(3) same as (2) but you pay immigration 1,900B for a denial of extension which gives you 7 days to leave Thailand.
You can then leave and come back on another visa.