You can have your residence permit extended for the purpose of studying before it expires if you meet certain requirements.