The best time to visit Rome is in spring and early fall, when the weather is mild and already (or yet) warm and sunny. The sultriness of July and August and abundance of rain in November is better avoided. Winters in Rome, too, are mild yet rainy. If this is your cup of tea, you can save money visiting the Eternal city in the low season.
If you decide to visit in summer, it is more important than ever to remember the famous saying “when in Rome, do as the Romans do”. It gets really hot in the afternoon, and because you are more than likely to be roaming Rome, no pun intended, all day, plan your itinerary in advance: get going early, take it easy in the afternoon, spend some time people-watching at a piazza, and continue going in early evening when the heat subsides. Also remember that in August some places you might want to grace with your presence may be closed due to Romans taking their vacations, as is the case in other European cities (most notably Paris).
October in Rome is an especially popular visiting time. This is the reason why in October accommodation prices go slightly up, even more so than for Christmas, all due to how perfect Rome is at this time of year. Do not let this discourage you; check apartment or hotel prices in advance, stay longer and get discounts for long-term stays, take a warm jacket for cool Roman evenings, enjoy the Roman sunsets to the fullest.