Most of Mexico has sunny weather year round, but it depends on where you go. The climate is largely determined by the topography, resulting in different climates for each region. On a whole, Mexicans and foreigners generally go to the highlands in summer and to the coast in winter.
Summer runs from June to October, which is also the rainy season.  It has the highest rainfall and highest temperatures in most places although the intensity depends on the region. The peak holiday months are July and August. Along the coastal areas, the hurricane season is from June to October (peak at August to mid-October). Winter is from December to April and is the traditional high season. Especially Acapulco, Cancun and the Riviera Maya become crowded; the resorts are packed at this time and prices go up drastically.
Taking all this into account, if you go to the coast, November is the ideal time to go. Rainy season and hurricanes should be over, water temperature is still pleasant (sea temperature of 26C – 29C). And it is not so crowded yet. Downside is that you’ll just miss out on Whale Shark Season (mid-May till mid-September) at Isla Holbox, but Bull Shark season (November – Feb/March) has just begun in Playa del Carmen!
Summarizing the best season per region:
  • Mexico’s Pacific coast: August to February.
  • Cancun: May to August
  • Riviera Maya & Cozumel: November to March/April
  • Whale Sharks at Isla Holbox: mid-May till mid-September
  • Bull Sharks at Playa del Carmen: November till March