There is no real best time to travel to Rio de Janeiro. In fact, Rio is a city that is good to visit all year around. What it is best for you may not be so for another visitor — it is a personal choice. Of course, on off-peak months you can have less tourists, better prices and discount on hotels, emptier tourist attractions but also cooler weather, less liveliness on the streets, and little party-feel in off-Rio de Janeiro towns like Paraty, Búzios and Ilha Grande.
The peak period in Rio de Janeiro is in December, January, February and March. During these months the famous landmarks such as Sugar Loaf and Christ statue are crowded on weekdays and overcrowded on weekends. Apart from that, the beach promenades in Copacabana and Ipanema are not really crowded (where you will probably hang out in your “time off”), except in the end of the afternoon when everyone (visitors and locals alike) head for their daily early evening stroll. This is the best time to travel to Rio de Janeiro if you miss the heat and/or want to be where people are.
Note that the school holiday period and the summer in Brazil (and in Latin America) is in December and January. This is when Brazilians from all over Brazil as well as Argentinians, Chileans and Uruguayans travel to Rio. Again, the city is crowd, but yet there is plenty of space (locals are still by far the majority).
Summer is Rio is hot and tends to be humid. Expect temperatures around 33°C (91°F). In the off-peak period such as April, May, June, August, September, October and November temperature ranges between 18-27°C (64-80°F). The off-peak months is the best time to travel to Rio, above all, if you can not stand high temperatures and humidity (of course, there is always a way around since cars, restaurants and hotel have air-conditioning).
Apart from that, there are two not-to-be-missed times of the year to travel to Rio de Janeiro: New Year’s Eve and Carnival (generally in February or, latest early March).
Bottom line: there’s no bad time to visit Rio de Janeiro, Brazil.

Planning to travel to Rio de Janeiro soon? Read in My Rio Travel Guide all you need to know to have the best vacation you will ever had.

Read related article: