Agree with SydneyN; Gargano's lovely, but a bit of a schlep - and would be even longer if you avoided the unattractive coastal highway- (especially the busy Bari ring road) and went a more pretty, scenic inland route via Ostuni- Cisternino and on to the trulli-strewn limestone 'Murge' plateau past Locorotondo (with a diversion to the baroque town of Martina Franca) - Alberobello...
So why not take the southern coastal road instead if you fancy a day trip? Otranto is well worth a visit for the bizarre skeletal relics of pirate raids in the church , and as you drive on to the beautiful, remote little 'land's end' port of Santa Maria di Leuca, some 100km or less than 2 hours south, the coast is increasingly less developed and more rugged. You could even continue on to Gallipoli on the way back.
I'm less personally familiar with public transport as we usually drive. Bus and rail in Puglia is not really part of the national network, but is run by local companies, so look for example at http://www.ferroviedelgargano.com/
If your Italian's up to it you'll see that there are some local trains and buses but these are slow (e.g. to Rodi Gargano - 2 hours from Foggia by rail and 4 hours by bus to Vieste) - e.g. click in the 'autolinee locali' box and the 'orari bus' tab.