Seville is three hours of train - Jerez is the shorter bet
The station by Plaza de Sevilla runs up to 12 regional trains a day to Seville, about 1.5 hours each way. That is three hours of a port day on rails, and at 12 a day the gaps between trains matter: know the last train that gets you back before all-aboard, and the one before it.
Jerez de la Frontera, 30 km away, is the easier independent trip. Up to 20 trains a day run there and to El Puerto de Santa Maria, so missing one is not a crisis - and the sherry bodegas are the reason to go.
Staying in Cadiz: mind the clock and Mondays
Smaller shops keep the long Spanish lunch - typically 9:30am-1:30pm and 4:30-8pm, Monday to Saturday - so a mid-afternoon wander through the old town can find shutters down. Museums usually close on Mondays, which catches out ships that call at the start of the week.
For a beach afternoon, La Caleta is the one inside the old town, with views of the fortress and beach facilities. Playa de la Victoria, the long city beach, is a ride away on bus 2 or 7.
Sources: whatsinport.com, cruisedig.com