It is a good idea to pack your first bag at least two days before the end of your cruise, giving you that much more free time to enjoy your final days onboard.
On the last night of the cruise, the ship will require you to pack and leave your bags outside of your stateroom. No need to worry though, the ship will also do a sweep of the hallways from midnight straight up until early morning, making sure all bags have been collected.
Be sure to leave out your outfit for the next day and make sure you have all your travel documents, identifications, any medications, cash and valuables with you. Also perform a final check of your stateroom and safe to ensure you have collected everything.