The validity of the Study Permit is generally equal to the program of studies’ duration, plus an additional 3 months. This additional time is given to allow you, either (i) to prepare an application for another permit or visa (Post-Graduate Work Permit, or Visitor for example), or (ii) to prepare your departure to your home country.
In case you want to continue studying in Canada after the expiration of your Study Permit, you need to apply for an extension of your permit.
Your Study Permit will expire 90 days following the completion of your study program (either (i) the date you receive a communication from your institution that you completed the program, or (ii) the date you receive your credential).