There are several ways to get there... and while a car might be the simplest because you have no schedules to follow, parking in San Gimignano can get costly (last time we were there, it was €2 per hour, probably not the best way to encourage visitors to stay a long while).
Coming from Florence
If you're coming from Florence, head in the direction of the A1 and take the "Firenze Impruneta" exit. Right next to the entrance to A1 is the entrance onto the Firenze-Siena roadway - take this road south. Exit at "Poggibonsi Nord", follow signs to "San Gimignano".
Coming from Siena
If you're coming up from Siena, follow signs toward Florence and get on the "Siena-Firenze" road, exit at "Poggibonsi Nord" and follow signs to "San Gimignano". You could also take a more scenic route, especially if the road work on the Siena-Firenze is still forcing everything into a single lane between Siena and Monteriggioni. Head for SS73bis, which will take you past towns like Sovicille and Colle val d'Elsa, where you will find indications for San Gimignano. This detour will add approximately 30 minutes driving time, but it will also give you a much more panoramic overview of the countryside.
Coming from Pisa
If you're coming from Pisa, follow the Firenze-Pisa-Livorno road toward Florence but don't go all the way to Florence, you'll end up driving more. It is better to take the "Empoli Ovest" exit and cross south through the countryside, a nice scenic drive as well. Follow signs for "Castelfiorentino-Certaldo" and once you're in Certaldo, follow signs to San Gimignano. Better yet, stop and visit Certaldo, too!
Once you're in San Gimignano, you'll have to park. Read more information on parking in San Gimignano.
Don't have a car while on vacation in Tuscany?
Don't worry, you can still visit San Gimignano during your vacation in Tuscany with public transportation.
There is no train station in San Gimignano, the nearest one is in Poggibonsi. So take the train to Poggibonsi, from there catch a bus, see below.
The bus line to take from Poggibonsi is 130 and sometimes it starts at the train station there, sometimes it arrives from Siena. In any case, in the morning up until 11am there are at least 2 buses every hour, if not more. The local bus company is called Tra.In.
If you're coming from Florence, the best way to get to San Gimignano is by bus rather than by train+bus. The BusItalia Nord (formerly SITA) bus company departs from its Santa Maria Novella bus depot (located on one side of the train station) and takes you to Poggibonsi, from there you catch the local bus to San Gimignano. By taking the bus the whole way, the timing is better coordinated with the bus change in Poggibonsi.
From Siena, take bus 130/A from train station, and they will tell you whether you will need to change buses in Poggibonsi or not.
There are other bus lines going to San Gimignano from nearby towns. From Certaldo, take bus 128. From Poggibonsi, there is also bus 133 but it takes a more roundabout way to get there (through Ulignano).
You can check bus schedules for bus 130 on here - they can be downloaded for each way.