It really depends on your ship’s docking schedule, but most folks have between 6 to 10 hours in the city. That’s actually a solid amount of time to see the highlights—especially if you plan ahead. If your ship docks at Pier 27 or Pier 35 (which is typical), you’re already near Fisherman’s Wharf, North Beach, and the Embarcadero. That means you could hit a few neighborhoods, get some sourdough and crab at the Wharf, maybe take a short city tour, or even visit Alcatraz if you book the early ferry.
The key is to build in at least 90 minutes to get back onboard, just in case traffic or lines slow you down. San Francisco traffic near the port can get messy by mid-afternoon, especially if there’s a Giants game or a festival in town. If you’re thinking about doing something further out like Muir Woods, it’s best to do it as part of a timed tour so you don’t risk missing your departure.