It’s recommended that you apply at least six months in advance for an application to a primary or secondary school, and at least one year in advance for any post-secondary programs in colleges, universities or other further education institutions.
You should always aim to submit your study permit application as soon as possible in case there are any delays in getting it processed by Immigration, Refugees and Citizenship Canada.