It is just like any other work permit/temporary residence permit - you are authorized to live and work in Canada until the date the work permit expires, and no one is a prisoner of Canada. While it is theoretically possible for you to be refused on entry (which is always true on any work permit), I think that would be unlikely unless you have given cause for IRCC to believe you will overstay.
You can stay and work in Canada until it expires, or you can obtain new authorization (e.g. new work permit, re-apply for PR and apply for new BOWP, etc.).