Canada requires that you complete the ArriveCAN 72 hours prior to boarding a cruise ship which ports in Canada or sails in its waters. As far as exact timing- the website is set up so that you CANNOT complete the form outside of the correct timing. So- if you can complete the form and get your approval you are inside the time required.
It is my understanding that ships which have not confirmed that passengers have the approval PRIOR TO BOARDING have been fined. And the boarding process severely disrupted when passengers arrive without the approval as they are required to complete the form and get the approval before being allowed to board.
It does get more complicated if you are going to Canada to board the ship. We arrive in Canada on Thursday, and sail on Friday. We will complete ArriveCAN late on Wednesday which will cover us for both the flight and the ship. I spoke with the ArriveCAN help desk and was assured that the single form would cover both, as long as the timing is good.