@Jack ******
when telling immigration you are leaving your current job, that is the date you extension expires. So if the school gives you a letter stating the end of your contract is Jan 20th. Your extension will expire Jan 20th and you must leave the country on Jan 20th.
Some schools will allow you not to cancel the extension until your new school has all the paperwork ready and you can switch it over the same day you inform immigration of leaving that job. (Although I believe some offices do not allow this so you will also need to check with the immigration office if this is something they accommodate.)