You need proper documents to re-enter Canada if you leave, so be sure to check your document expiration dates and renew them if necessary before you travel. If your study permit will expire while you are outside Canada, you should speak with an international student advisor before traveling. It is possible to apply for a new initial study permit (not a study permit extension) while outside of Canada, but it may take longer depending on your location.
It is best not to leave Canada while an immigration document extension is being processed, especially if your current document will expire while you are abroad. Please see an international student advisor for details.
Check Immigration, Refugees and Citizenship Canada (IRCC)'s processing times to plan ahead.