A lot will depends on your ability to get a rental car quickly after disembarking. I presume there will be lots of Cruiseiders trying to rent a car. Both Avis-Budget and Hertz have offices at the Cruise terminal in Livorno.
Once you are on the car and off the lot, the drive to Volterra shouldn't be longer than 1.5 hours, maybe 2 hours to allow for photo stops along the way. The drive is easy, part freeway, part 2 lane highway straight and flat along the Val D'Era (Era Valley) and then a few curves to go up to the center of town (Volterra sits on top of a hill). If you also want to add San Gimignano, then it's almost another hour drive from Volterra, and it's a curvy highway. Coming back from San Gimignano di Livorno it's at least another 1.5 hours (if you don't stop).
So if you want to include both it is going to be a busy day.
If you don't have a car, then it's complicated to include both, actually I don't recommend it because the two places are not well served by public transport.
Volterra: this is probably the easier target without a car. Basically take a train from Livorno Centrale to Pontedera (along the Livorno-Pisa-Florence railway), then at Pontedera there are buses to Volterra. This is the best way to Volterra by train-bus. Do not go to Saline via train, because there are really no significant bus service from Saline to Volterra, and even the trains to Saline are not frequent at all.
San Gimignano, could be reached from Livorno but takes time. You need a train from Livorno to Empoli (still along the Livorno-Pisa-Florence line), then at Empoli you take a train toward Siena. You need to alight the train at either Certaldo or Poggibonsi, where you take the bus for the last leg. It's convoluted trip, so it takes a lot of time.
Obviously visiting BOTH Volterra and San Gimignano via train/buses in the 10 hour window, is practically impossible, therefore you need to choose. I would choose Volterra over San Gimignano, simply because it's easier to get there from Livorno using train+bus.