A vast country such as Brazil invariably has a diverse climate. Generally speaking, the further South one travels in Brazil, the more temperate the climate. Heavy rains fall at different times in different regions: November to March is the rainy season in South-East Brazil; December to March in the central and Western regions; and April to August sees the heaviest rains on the North East coast. In Brazil's Amazon region and the far North around Belem, it can rain year round, but the heaviest and most prolonged downpours are between March and May.
In general terms, the climate is described as winter from the months of May to September . The climate of Southern Brazil is worthy of particular mention at this time of year - it's not quite hot enough to base a vacation on Brazil's beaches. During winter, Rio may see a few hot days worthy of taking to beaches such as Ipanema, but as one travels further South it's unlikely to be beach type weather. So if visiting Florianopolis hooping for fine weather, don't do so during the winter months.
Carnival is in February - this is a hot, humid and often rainy time throughout the country, including Rio de Janeiro. Having said that, rainfall is rarely prolonged (anywhere and anytime), so if you are on vacation to visit Brazil's beaches, there will probably be a few rainy spells here and there year-round. Another point to consider is that mid-December to the end of February sees Brazil's national holidays, so prices rise, beaches are more crowded and hotel rooms more scarce - book hotels in advance.