There is no set maximum amount of time you can work as a temporary worker in Canada. Instead, the length of time you can work depends on:
The type of job offer from your employer
The length of time listed on your Labour Market Impact Assessment, if your employer needed to get one to hire you
How long your passport or visitor visa is valid for
You should always double-check your documents to ensure that you don’t accidentally overstay your temporary work visit.