Your RRSP contribution for any given year is the lower of:
- 18% of your earned income from the previous year
- The maximum annual contribution limit for the taxation year (posted by the CRA online)
- The remaining limit after any company-sponsored pension plan contribution
Any unused contribution room from 1991 onwards can be carried forward to the current year. Every Canadian is allowed to over-contribute $2,000 once in their lifetime but if you over-contribute beyond this amount, you'll be charged a penalty tax of 1% of the over-contribution amount per month.
You can read more about RRSP contributions and see the maximum contribution limit for each year on the Canadian Revenue Agency website.