Usually a visitor gets six months of stay in Canada. The CBSA officer mostly stamps the travel document/passport and writes the date underneath the stamp until when a visitor is allowed to stay in Canada. If a CBSA officer doubts the intentions of a visitor for various reasons (no return ticket, travel document expiring in the near future, no clear purpose of visit, unstable financial circumstances), he or she can grant status for less than six months. You must apply to extend your visitor status in Canada as soon as possible. Generally a 30 day period before the expiry of status is recommended by IRRC.
If a visitor, worker or student has lost their status, they may apply to reinstate or restore their status in accordance with R182 of IRPR. This regulation only applies if the temporary resident has not been out of status for more than 90 days, and they have not failed to comply with the specified conditions. Restoration of status cannot be granted at the POE. Individuals who have failed to comply with the conditions imposed under R185 need to apply in Canada for restoration of their status. If they leave Canada, they will be deemed to be seeking a new entry on their return. Once the application for restoration of status is submitted, you are allowed to remain in Canada but are not eligible to work or study. You can do so once you receive the approval on the application.