Map from Google - Saint_Petersburg

In St. Petersburg, a city located in northwestern Russia, the climate is continental, with freezing winters and pleasantly warm summers. In winter, snowfalls are frequent, as well as rainfall in summer. The wind often blows, although it calms down a bit in summer.
Here are the average temperatures.
Average temperatures - St Petersburg
St PetersburgJanFebMarAprMayJunJulAugSepOctNovDec
St PetersburgJFMAMJJASOND
Min (°C)-11-11-60611141383-2-8
Max (°C)-5-518162022201582-3
Min (°F)121221324352575546372818
Max (°F)232334466168726859463627

Precipitation is not abundant, since it amounts to 610 millimetres (24 inches) per year, but occurs frequently: in winter, when it occurs in the form of snow, it's even more frequent, but given the cold, it's rarely abundant. Here is the average precipitation.
Average precipitation - St Petersburg
St PetersburgJanFebMarAprMayJunJulAugSepOctNovDecYear
St PetersburgJFMAMJJASONDY
Prec. (mm)353030354550708065754550610
Prec. (in)1.41.21.21.41.822.83.12.631.8224
Days1412988881011121214126

Winter, from late November to late March, is very cold: the average temperature in January and February is -8 °C (18 °F). The Gulf of Finland and the nearby Lake Ladoga do not mitigate the winter weather, because they are usually frozen. The wind blows frequently, increasing the feeling of cold.
The days are very short, especially in December and January, while in February they become longer. On the 21st of December, the sun rises at about 10 a.m. and sets at 4 p.m., on the 15th of January it already sets at 5.30 p.m., and on the 15th of February it sets at 6.50 p.m.
In periods in which the westerlies from the Atlantic Ocean prevail, the temperature fluctuates around 0 °C (32 °F), and may even go up a few degrees above; the sky is gray, and a light snow or a cold drizzle falls.
More often, the temperature remains a few degrees below freezing (0 °C or 32 °F) all day long, the sky is still gray, and a light snow falls.
Then, there are periods in which cold air masses from the North Pole or Siberia prevail: in these cases, the temperature sinks well below freezing. Minimum temperatures of -30 °C (-22 °F) and even lower, were once relatively frequent: in February 1966 the temperature plunged to -37 °C (-35 °F), in December 1978 to -39 °C (-38 °F), in February 1979 to -33 °C (-27 °F), and in January 1987 to -35 °C (-31 °F). In recent years this has happened more rarely, however, in December 1996 it reached -29 °C (-20 °F), in January 2006 -30 °C (-22 °F), in February 2006 -29 °C (-20 °F), in February 2011 -30 °C (-22 °F), and in February 2012 -27 °C (-17 °F).
In March it can sometimes be very cold as well: in 1963 the temperature reached -30 °C (-22 °F), in 1966 -23 °C (-9 °F), in 1987 -22 °C (-8 °F), and in 2006 -24 °C (-11 °F).
Light snow can fall even on colder days, and in the winter months a bit of snow falling can be seen almost every day.

Spring, in April and May, is cold and windy, especially in the first part, but the days are long, and by the middle of May you can see the white nights, that is, when it doesn't get completely dark even at midnight. In early April, the temperature is often around freezing or below, and it can still snow. With each passing week the temperatures rises a bit, and you can see the first mild days, but it continues to get cold at night, often still in May. Starting from May, usually in the second half, there can be the first hot days, in which highs can approach 30 °C (86 °F).

Summer, from June to August, is mild: the average temperature of July is 18 °C (64 °F). Some periods are cool, windy and rainy, more often in August, compared with June and July. However, there may be also warm and sunny periods, with maximum temperatures around 30 °C (86 °F), while nights remain cool. Occasionally, there can be hot and muggy periods, usually of short duration, in which the maximum temperature can exceed 30 °C (86 °F), and the minimum temperature 20 °C (68 °F).
The days are very long, and the white nights occur until early August. This phenomenon, however, is more evident in June and early July, since the day when the sun is closer to the horizon at midnight is the 21st of June, the summer solstice.

Autumn, from September to November, is initially quite cool and rainy, and becomes increasingly more cold and gray. The first snowfalls can occur already in October, although the snow covers the ground in a more stable manner from the third week of November. In November, the days are already very short: in the 15th of November the sun rises at 9 a.m. and sets at 4.30 in the afternoon.

The amount of sunshine in St. Petersburg is definitely scarce from October to February, when the sun is hardly ever seen, while it is acceptable from May to August, also because of the length of the day, which increases the chance of seeing the sun, when the sky clears up.

Saint Petersburg, Winter Palace

The sea in St. Petersburg is cold all year round; in winter it's near freezing and can sometimes freeze; in summer it only reaches 15 °C (59 °F) in August.
Here are the average sea temperatures.
Sea temperature - St Petersburg
St PetersburgJanFebMarAprMayJunJulAugSepOctNovDec
St PetersburgJFMAMJJASOND
Sea (°C)100148131513963
Sea (°F)343232343946555955484337

When to go

The best time to visit St. Petersburg is the summer, from June to August. The temperature is generally mild or pleasantly warm, but there can be rainy and cool days, so it's better to bring a sweatshirt, a jacket and an umbrella, hoping not to have to use them. In fact, hot and sunny days can occur as well. June is cooler than July, but in the solstice period the white nights are more evident.