Missing a cruise ship is rare, but entirely possible. Cruise lines publish an all-aboard time for every port call, usually before the ship’s actual departure time, and passengers exploring independently are responsible for meeting it. Royal Caribbean, for example, says its all-aboard time is generally around 30 minutes before sailing, although passengers should always check the time given onboard and at the gangway for that particular call.
If you don't make it, the ship may wait briefly while crew try to establish where you are. It may not. What happens next depends on the port, your itinerary, why you're late and, rather importantly, whether the coach currently stuck in traffic belongs to the cruise line.

Yes.
Cruise ships aren't obliged to delay departure for passengers who have gone ashore independently. Norwegian Cruise Line's UK terms are particularly unambiguous: if you fail to embark on time at any port, the line doesn't have to delay the ship or change its itinerary, and the resulting costs are yours.
That doesn't mean the gangway is hauled in with sadistic precision at 5.00.01pm. Ship staff know who has gone ashore because passengers scan their cruise cards when leaving and returning, so they can identify who is still missing as departure approaches. The ship may try to contact you, and there can be some discretion depending on the circumstances.
But “surely they won't leave without us” is a poor basis on which to order another bottle of wine. Port schedules, navigation requirements and the next destination all continue to exist regardless of how nice your afternoon has been. Once the decision to sail is made, your problem changes from getting back to the pier to getting back to the ship.
Find the port agent. Cruise lines appoint local agents to handle their affairs in each port. Princess specifically tells passengers who miss the ship to contact the port agent using the details printed in its onboard newsletter. The agent can contact the vessel, establish whether and where you're permitted to rejoin it, and help arrange onward travel or a return home.
That last part is important. Don't immediately book the first flight to tomorrow's port because you've looked at the itinerary and decided this is all basically self-explanatory. It isn't. The cruise line needs to confirm that you can actually reboard there.

Sometimes. Not always.
Royal Caribbean says passengers who miss embarkation may be able to join at a later port if they have the correct documentation, but this has to be agreed with the cruise line. Princess similarly describes rejoining at the next available port as subject to approval. Immigration and maritime rules can make things surprisingly complicated.
A ship may cross into another country overnight. You may need a visa that wasn't required when you were merely visiting as a cruise passenger. Some itineraries have restrictions on where passengers can embark or disembark, and US cruises can be affected by cabotage rules such as the Passenger Vessel Services Act. Carnival explicitly warns that, on some US itineraries, a passenger who misses the original departure cannot simply join at another US port if doing so would breach those rules.
Even within Europe, leaving a cruise to travel independently onwards can change how immigration formalities apply. UK government guidance notes, for example, that passengers leaving a cruise within the Schengen area to travel to another destination may need to complete Entry/Exit checks. In short, the next port on the map isn't automatically the next place you're allowed back onboard. Call first. Purchase expensive, panic-stricken air travel second.

This is where things can become particularly exciting, in the administrative sense of the word. Depending on the itinerary, your passport may be in your cabin safe, carried with you ashore or held by the ship for immigration processing.
When passengers are left behind, crew will often try to get essential documents such as passports to the local port agent before departure. Cruise Critic reports that passports and other essentials are commonly removed from the ship and handed to the agent when crew know a passenger hasn't returned. But don't regard that as a guaranteed emergency valet service.
Procedures vary between ships and ports, and there may simply not be enough time. If your passport sails off without you, the port agent and cruise line should be your first contacts. If it can't be recovered and you need emergency documentation, you may then need consular assistance. The FCDO recommends travelling with access to copies of important documents, insurance details and emergency contacts, as well as making sure you can access funds if your usual payment method fails.
This is one of those pieces of sensible government advice that sounds unnecessarily cautious right up until you're on a quayside watching Deck 12 become very small.
Usually, it continues the cruise without you. Your clothes, luggage and increasingly forlorn toothbrush don't automatically come off the ship because you haven't returned. If you're able to rejoin later, they'll generally remain in your cabin.
If you can't rejoin and have to abandon the rest of the cruise, you'll need to arrange with the cruise line for your belongings to be returned. How that happens will depend on the route, where the sailing ends and the individual line. It's another reason to take the useful bits ashore rather than carrying nothing but a cruise card and misplaced confidence.
A charged phone, access to money, travel insurance details, appropriate identification and the port agent's contact details are considerably more valuable after a missed departure than the emergency paperback you left beside the pool.

Here, the situation changes considerably. One of the less glamorous advantages of booking the ship's own shore excursions is protection against becoming stranded.
Princess advertises a guaranteed return to ship for its excursions: if a Princess-booked tour is delayed, the ship waits or the cruise line arranges transport to the next port. Royal Caribbean offers essentially the same promise, saying the ship will wait for delayed guests on its excursions or, if circumstances make waiting impossible, arrange and pay for their return to the vessel.
That doesn't mean every cruise ship will remain tied to the quay indefinitely because one coach has encountered a particularly determined traffic jam. Sometimes it genuinely can't. The important distinction is who then owns the problem. If you've booked the cruise line's excursion, the line has a mechanism for getting you back. If you've arranged your own day and return late, the taxi to the airport, hotel, flight, transfer and associated emotional collapse are generally yours.
Independent excursions can still be excellent, often cheaper and far more flexible. They simply require a sensible margin before all-aboard.
Possibly, but “I was having a really nice time” is unlikely to appear among the insured events. This is where the phrase “missed departure cover” can be misleading. It doesn't usually mean insurance pays whenever you miss a departure.
MoneyHelper says a good travel policy should cover additional transport and accommodation if you miss a flight, train or boat for certain circumstances beyond your control, such as your car breaking down, an accident or public transport being delayed. It also points out that you're unlikely to be covered if you simply failed to allow enough time.
Cruise-specific cover can go further. As one current example, Post Office Cruise Cover extends its missed-departure and connection protection to ports along the cruise itinerary, subject to the causes, limits and exclusions in the policy. The exact wording matters enormously.
A train cancellation may be covered. A road accident might be covered. Losing a passport may be covered by some policies. Discovering that the charming family-run restaurant takes 25 minutes to produce the bill almost certainly won't be. If you do miss the ship because of something potentially insured, contact your insurer as soon as possible and keep receipts for flights, hotels, taxis and other expenses. Don't assume they'll reimburse whatever solution you improvise without checking first.

Potentially very.
The cruise fare itself is only part of the problem. Depending on where you are and where the vessel goes next, you might need a hotel, taxis, a last-minute flight, ferries, visas or other immigration costs. NCL's UK booking conditions explicitly put costs such as transport, accommodation, airfare, visa fees, subsistence, car hire and agency fees on the passenger if they fail to return on time.
And some routes are much easier to recover than others. Missing a ship in Barcelona when it sails next to Marseille is irritating. Missing an expedition vessel somewhere whose nearest airport regards three flights a week as a perfectly adequate service is a rather more ambitious error. The sensible time buffer therefore depends on where you are. An afternoon wandering independently around Tallinn deserves a different risk calculation from a three-hour drive inland from an isolated tender port.
There isn't one magic buffer. If you're walking around a compact city ten minutes from the gangway, you can reasonably use more of your day than somebody returning from an independent excursion two hours inland.
Work backwards from the all-aboard time rather than the scheduled departure. Factor in traffic, queues, tender boats, public transport connections and the possibility that the final kilometre may take considerably longer than Google Maps suggested while you were sitting comfortably at breakfast. And keep the port agent's details with you. Princess publishes them in its daily programme specifically for situations such as this. Photographing the relevant page before going ashore takes approximately four seconds and may save you having to identify “somebody who works for the ship” while experiencing the early stages of cardiac arrest.
The ship doesn't generally perform a dramatic U-turn. You contact the port agent and the cruise line. They establish whether you can rejoin and where. You recover your passport if possible, speak to your insurer, then arrange the necessary transport and accommodation.
If you were delayed on an official ship excursion, the cruise line should take responsibility according to its excursion guarantee. If you were exploring independently, the money and logistics will usually be yours. It is survivable. People rejoin cruises after missed departures. It is also an unusually elaborate way to learn that “all aboard at 5.30” wasn't a suggestion.
So have the long lunch. Order dessert. Wander down the side street because it looks interesting. Just occasionally look at your watch.