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 (°F)121221324352575546372818
Max (°F)232334466168726859463627

Precipitation is not abundant, since it amounts to 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. (in)

Winter, from late November to late March, is very cold: the average temperature in January and February is 17.5 °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 December the 21st, the sun rises at about 10 a.m. and sets at 16 p.m., in January the 15th it sets already at 17.30, and in February the 15th at 18.50.
In periods in which the westerlies prevail, coming from the Atlantic Ocean, the temperature fluctuates around freezing 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 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 -20 °F were once relatively frequent, and even lower: in February 1966 the temperature plunged to -34.5 °F, in December 1978 to -38 °F, in February 1979 to -27.5 °F, in January 1987 to -31 °F. In recent years this has happened more rarely, however, in December 1996 it reached -20 °F, in 2006, -22 °F in January and -20 °F in February, in February 2011 -22 °F, and in February 2012 -16.5 °F.
Also in March it can be very cold: in 1963 it reached -22 °F, in 1966 -9.5 °F, in 1987 -7.5 °F, in 2006 -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 85 °F.

Summer, from June to August, is mild: the average temperature of July is 64.5 °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 85 °F, while nights remain cool. Occasionally there may be periods, usually short, hot and muggy, when the maximum temperatures can exceed 85 °F and the minimum temperatures 70 °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 June the 21st, 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 November the 15th 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 59 °F in August.
Here are the average sea temperatures.
Sea temperature - St Petersburg
St PetersburgJanFebMarAprMayJunJulAugSepOctNovDec
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.