Rome, where it is

The climate of Rome, the capital of Italy, is Mediterranean, though with some slight elements of continentality. Winter is mild and quite rainy, but at night, it can get cold; summer is hot and sunny, with a few afternoon thunderstorms.
Here are the average temperatures.
Rome - Average temperatures
Min (°C)335812161919161285
Max (°C)121315182328313127221612
Min (°F)373741465461666661544641
Max (°F)545559647382888881726154

Rainfall amounts to about 800 millimeters (31.5 inches) per year; the wettest season is autumn, followed by winter. In spring, there is a certain increase in the rainfall in April compared with the previous months.
Here is the average precipitation.
Rome - Average precipitation

Winter, from December to February, is quite mild: the average temperature in January is about 7.5 °C (45.5 °F). There is a moderate amount of sunny days, which can be mild, with highs around 12/15 °C (54/59 °F), but it often gets cold at night, with lows around freezing (0 °C or 32 °F) or slightly above. Cloudy periods, accompanied by wind and rain, are milder, especially at night, both because of the southern wind, which usually blows in periods of bad weather, and of cloud cover, which is able to prevent nocturnal cooling.
The wind from the north, the Tramontana, brings cold and sunny days, with highs below 10 °C (50 °F) and possible light frosts at night. On colder nights, the temperature rarely drops below -5 °C (23 °F) in the countryside, while within the city, owing to the urban heat island effect, frosts are very rare. Snow is a very rare phenomenon, which occurs once every few years because, as we mentioned, cold periods are usually sunny. Sometimes, however, quite heavy snowfalls may occur, from 10 to 40 cm (4 to 16 in), as happened in December 1939, February 1956, February 1965, March 1971, January 1985, February 1986, and February 2012.
In early December, autumn-like weather can still prevail, with mild temperatures, above 15 °C (59 °F), and abundant rainfall. In the second half of February, during some years, the first spring-like days can already occur.

Spring is a mild and relatively rainy season. In March, the first spring days, with highs around 18/20 °C (64/68 °F), alternate with some colder days. The temperature often remains cool enough until mid-April, when highs remain around 15/17 °C (59/63 °F). At Easter, the weather is usually variable, with sunshine and rain, and sometimes even a bit of cold.
By the second half of April, nice days, with 20 °C (68 °F) or more during the day, become more frequent, and this happens normally in May. In May, the italian capital is in bloom, and in the first warm days, the sea breeze cools down the air in the afternoon. Sometimes, in the first half of the month, it can still be cool, with some rain and a bit of cold at night.

Summer, from June to August, is hot and sunny; clear days are the norm, especially in July and August. Some rare thunderstorms can occur in the afternoon, especially in the northern and eastern neighbourhoods of the city, which are more distant from the sea.
The afternoon breeze, called "ponentino" ("little west wind"), tempers a little the heat, but it's felt especially in the southern and western districts, which are closer to the sea, while it reaches with some difficulty the center and the most densely populated areas. Owing to the so-called "urban heat island effect", the night temperature is a few degrees higher than in the countryside, and in the center, it often remains above 20 °C (68 °F). Nights are often sultry. On hot days, the temperature easily reaches 34/35 °C (93/95 °F), and every year, it reaches, at least for a few days, 37/38 °C (99/100 °F). It goes better on the Roman coast, where the daytime temperature is usually a few degrees lower than in the city proper.

Autumn, from September to November, is mild and humid; in this season, sunny days alternate with periods of cloudy skies and rain, which gradually become more frequent. In this season, the southerly winds dominate, either the libeccio, which blows from the south-west, or the scirocco, which blows from the south-east. During the night, thunderstorms can erupt, at times intense. There is a moderate amount of sunny days, at least in the first part; the nice and almost summer-like days occurring in October are called ottobrate, and are frequent especially in the first half of the month, with highs around 23/25 °C (73/77 °F), while when the scirocco blows, the temperature can reach 28/30 °C (82/86 °F) even in the first half of October.
In November, the rains are frequent and the temperature decreases quite rapidly: at the beginning of the month, the temperature is often very mild, around 20 °C (68 °F); in the middle of the month, it drops to around 15/17 °C (59/63 °F), while at the end of the month, by now the weather is often similar to that of winter.

Rome - via dei Fori Imperiali

On average, the amount of sunshine in Rome is never scarce: clear days are always possible, but in winter, they alternate with periods of cloudy and bad weather. In spring, sunshine gradually increases, and becomes frequent in May. In summer, the sky is almost always clear, especially in July and August. In autumn, Atlantic or Mediterranean depressions become gradually more frequent, and November is often a gray and cloudy month. Here are the average sunshine hours per day.
Rome - Sunshine

On the Roman coast (Ostia, Fregene, Fiumicino, Santa Marinella etc.), the sea is warm enough for swimming from July to September. In June, it is still a bit cool. Here are the average sea temperatures.
Ostia - Sea temperature
Temp (°C)151414151822252624211916
Temp (°F)595757596472777975706661

Best Time

The best times to visit Rome are spring and autumn, ie from mid-April to mid-June and from September to early October. In June, the weather is often nice, but it can sometimes be hot, especially in the second half of the month. Until early May, some days can still be a bit cold and windy, and in September and October, it can rain.
In mid-summer, in July and August, the weather is usually sunny, but it can be very hot. However, tourists flock to the city, and those who stand the heat can choose this period as well, keeping in mind that there's a lot to walk in the extensive historic center of the Eternal City.