You can visit San Francisco throughout the year, and it enjoys a mild climate year round, although you should not confuse it with the sunnier warmer weather that you get down the coast in Los Angeles.
Mornings, and winter can get chilly, and it pays to make sure that you take warm clothes with you, particularly in winter.