Hotels in Rio de Janeiro are at their absolute peak in price and occupancy during the week of Carnival, which happens 7 weeks before Easter, and takes place in either February or March. In 2011 it’s March 4th until March 8th and in 2012 it’s February 17th until February 21st. Hotel prices during this period at least double and in some places triple or quadruple from their normal “high season” rates. If you are coming during Carnival, book as long in advance as you can, as every room in town will eventually fill up.
The general high season lasts from December through March, usually ending after Carnival itself. If you are coming anytime between April and November then you should be able to get a room when you arrive, and you’ll probably will get a pretty good deal too. Still, the better places do get booked up in advance so if you want to stay near one of the popular beaches it’s a good idea to book ahead regardless of the season.