@Lexi *****
, you would take a paper from your school stating you are no longer studying anymore and go to the immigration office before that to cancel your extension.
They will cancel your current extension and stamp you in until the date on the paper from the school (which the school usually writes is the last day of your extension). This cancels it in the immigration system and then when you leave the country and come back you're fine.