Map from Google - Oslo

The climate of Oslo is Baltic semi-continental, that is, it's similar to that of the cities located along the coasts of the Baltic Sea, so it is very cold in winter, with temperatures below freezing (0 °C or 32 °F), and mild or pleasantly warm in summer.
Here are the average temperatures.
Average temperatures - Oslo
OsloJanFebMarAprMayJunJulAugSepOctNovDec
OsloJFMAMJJASOND
Min (°C)-7-7-31711121184-2-6
Max (°C)-2-149162022201593-1
Min (°F)191927344552545246392821
Max (°F)283039486168726859483730

Precipitation amounts to 765 millimetres (30 inches) per year, and is well distributed over the seasons, however, the least rainy (or snowy) seasons are winter and spring.
Here is the average precipitation.
Average precipitation - Oslo
OsloJanFebMarAprMayJunJulAugSepOctNovDecYear
OsloJFMAMJJASONDY
Prec. (mm)503545405565809090857555765
Prec. (in)21.41.81.62.22.63.13.53.53.332.230.1
Days988781011111111109113

In winter, the temperature stays around freezing or below from November to March. There are about 80 days with snow, occurring from late October to mid-April. However, the temperature can vary greatly: when Atlantic currents prevail, even the temperature can exceed freezing in winter, and snow can melt, while when currents blow from Siberia or a polar anticyclone moves over Scandinavia, it can drop below -20 °C (-4 °F). Due to the high latitude, the days are very short especially in December and early January (the sun sets at 3:10 pm in mid-December, and at 3:45 p.m. in mid-January), while in February the days are already a bit longer (in mid-February the sun sets at 5 p.m.), although the temperature is usually the same as in January.

In spring, in April and May, the temperature rises quickly enough. Typically the thaw occurs in late March or early April, so in early April there can still be snow and frost, while during the month the first mild days occur. Spring is the season in which Atlantic disturbances are, albeit slightly, less frequent. In the second half of May, during some years an anticyclone can move over northern Europe and Norway, able to bring a period of nice and warm weather.

Summer, from June to August, is mild, with cool nights and pleasant days. Hot days are rare, though sometimes the temperature can reach as high as 30 °C (86 °F). The rains can occur also in summer, because the flow of Atlantic fronts at these latitudes never stops: in fact there are 10/11 days with rain also in the summer months. The days are very long: roughly from mid-May to early August, you can experience the phenomenon of the "white nights", in which it does not get completely dark even at midnight. However, the sun sets at 10.45 p.m. in late June, at 10 p.m. in late July, and at 8.45 p.m. in late August.

Autumn, is cool, cloudy and rainy already in September, and then gradually becomes colder. The first snowfalls can be seen already in October. In November, the days are very short, it is cold and the sun is a rarity: in fact it's already winter.

Altogether, the amount of sunshine in Oslo is acceptable in May and June, and still in July and August, thanks also to the length of the day. On the contrary, the sun is practically never seen from November to January, also due to the very short days.

Oslo

The sea in the Oslo fjord is cold even in summer, however, it reaches 17 °C (63 °F) in July and August, which means that the more daring can try to swim.
Here are the average sea temperatures.
Sea temperature - Oslo
OsloJanFebMarAprMayJunJulAugSepOctNovDec
OsloJFMAMJJASOND
Sea (°C)544610141717151296
Sea (°F)413939435057636359544843

When to go

The best time to visit Oslo is the summer, from June to August. The temperature is generally pleasant for outdoor activities, but at night it can be cool, or even a little cold. Moreover, there's no shortage of rainy days. However, if you are lucky, you can find daytime temperatures above 25 °C (77 °F). June is slightly cooler than August, but the days are very long, and the phenomenon of the white nights is very evident, especially around the summer solstice, the 21th of June.