We arrived in San Francisco with an 8-hour layover. We hopped the BART (train out of the airport) for $16 one-way, got off at the Civic Centre to go upstairs and transfer to the MUNI (municipal transit) N-line train for $2 (or was it $4?) one-way, to 9th avenue. We walked the 2 blocks to the Golden Gate Park. It took us 2 hours to get to the park after taking time to get information, figure out ticketing kiosks, map our route, etc; it took 1 hour to get from the park to the airport. Trains run at 10-20 minute intervals.
We enjoyed a wonderful day in the park and in 1.5 hours walked from the 9th Ave entrance down to the ocean; it was about 2 hours back. We were walking fairly quickly.
The park is a very large city park with lots of forested areas but with many highly developed areas as well. I wouldn't say that it's the best park I've ever been to, but it stands out for its size. It certainly beat languishing in the airport waiting for our next flight.