On big ships, your shipboard account will close just before the end of your cruise, but before that time, you will receive a preliminary bill in your cabin. If you are using a credit card, just make sure the charges are correct; your credit card will be charged automatically as part of the end-of-cruise procedures. If there is a problem, you will have to go to the purser's office, where you will likely encounter long lines. If you're paying by cash, you'll be asked to settle your account during the day or night before you leave the ship.
Photo Gallery of Settling Your Shipboard Account Cruises
Click to on Photo for Next Settling Your Shipboard Account Cruises Images
This will also require that you go to the purser's office. A final invoice will be delivered to your room before departure.
On small ships, the procedure will be simpler. Often you can just mosey over to the purser's desk on the last evening, check to see that the bill they give you looks right, and sign your name.