Map from Google - Saint_Petersburg

In St. Petersburg, city located in northwestern Russia, the climate is continental, with freezing winters and pleasantly warm summers. The winter snowfalls are frequent, as well as the summer rains. Wind often blows, although it calms down a bit in summer.
Here are the average temperatures.
Average temperatures - St Petersburg
St PetersburgJanFebMarAprMayJunJulAugSepOctNovDec
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
Prec. (mm)353030354550708065754550610
Prec. (in)

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 nearby Lake Ladoga do not mitigate the winter weather, because they are usually frozen. Wind blows frequently, increasing the feeling of cold.
The days are very short, especially in December and January, while in February they are already longer. In the 21st of December, the sun rises at about 10 a.m. and sets at 16 p.m., in the 15th of January it sets already at 17.30, and in the 15th of February at 18.50.
In periods in which the westerlies prevail, coming from the Atlantic Ocean, 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 when cold air masses come from the North Pole or Siberia: in these cases, the temperature sinks well below freezing. Minimum temperatures of -30 °C (-22 °F) were once relatively frequent, and even lower: 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), 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 2006, -30 °C (-22 °F) in January and -29 °C (-20 °F) in February, in February 2011 -30 °C (-22 °F), and in February 2012 -27 °C (-17 °F).
Also in March it can be very cold: in 1963 it 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 a bit of it in the winter months 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's not 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 in May. Starting in May, usually in the second half, there can be the first warm 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, when maximum temperatures hover around 30 °C (86 °F), while nights remain cool. Occasionally there may be periods, usually short, hot and muggy, when the maximum temperatures can exceed 30 °C (86 °F) and the minimum temperatures 20 °C (68 °F).
The days are very long, and up to early August there are still the white nights. 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 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 it.

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 reaches just 15 °C (59 °F) in August.
Here are the average sea temperatures.
Sea temperature - St Petersburg
St PetersburgJanFebMarAprMayJunJulAugSepOctNovDec
Sea (°C)100148131513963
Sea (°F)343232343946555955484337

When to go

The best time to visit St. Petersburg is the summer, from June to August. The temperatures are generally mild or pleasantly warm, but there can be rainy and cool days, so it's better to bring a sweatshirt, jacket and umbrella. However, also hot and sunny days can occur. June is cooler than July, but near the solstice the white nights are more evident.