I just searched a few times on Google Maps in different neighborhoods and I think I found about 50 gas stations, which didn't feel like a complete list to me. Especially along Van Ness and Lombard (signed as US-101), 19th Avenue (signed as CA-1), and exits from the 101 and 280, they are fairly numerous.
Google Maps found more than 20 in the southeastern neighborhoods alone!
I don't mean to argue from anecdotes, but I've never known anyone who lives in San Francisco and owns a car to complain that gas stations are particularly rare or hard to find or access here. (They may often complain about parking, but not as much about gas stations.)