This depends on which immigration program to which you wish to apply and your eligibility for said program. There are many pathways to permanent residence for international students. There are a few Provincial Nominee Programs (PNPs) which allow international graduates to apply immediately upon graduation. As well, if you meet other conditions, like having a job offer, or already possessing Canadian experience, you might be eligible for other immigration programs.
However, one of the more common pathways for international students is through the post-graduation work permit (PGWP). Upon graduation, most international students are eligible for a PGWP, authorizing them to stay in Canada and work for a certain amount of time. Once a candidate has gained one year of full-time, skilled work experience in Canada, they often become eligible for the Canadian Experience Class, a program contained within Canada’s Express Entry system.