The historical town of San Gimignano on the hill has no train station, but you can easily reach San Gimignano by taking a train to Poggibonsi labelled "Poggibonsi-S.G." and then a bus from the Poggibonsi train station to San Gimignano. These buses cost €3.60 2007 each way, leave every 30-40 minutes, and you can inquire for information, schedules, and tickets at the tourist information office which is located ahead toward the right as you walk out of the train station.
If you are going from Florence Firenze to Poggibonsi, direct trains are not so frequent but you will find many connections via Empoli.
You may also arrive by car. You can't drive inside the town walls, but there are several pay parking lots just outside the town walls, with free places further away. The handiest lot, Parcheggio Montemaggio, outside Porta San Giovanni, fills quickly, but they let 1 car in for every one that leaves, so you can wait €2/hour. There is free parking on the side of the road going down from the turnabout.
Easily reachable from Florence or Siena, though you may have to change buses in Poggibonsi. Buses leave from Florence's bus station next to the train station hourly, and take 1.25 to 2 hours for €6. From Siena there are €5.20, 75 minute buse rides 5 a day
Buses depart from Porta San Giovanni, with tickets sold at the bar just inside the gate or at the Tourist Info. Florence buses leave hourly, change in Poggibonsi, and take 1.25-2 hours. Siena buses are 5/day, 75 minutes, and also change in Poggibonsi. Volterra has 4/day that take 2 hours and change in Colle di Val d'Elsa. Sunday buses are fewer and more crowded.