Considering weather, prices, and crowds, the best times to visit the Yucatán Peninsula  are from late November to mid-December, and from mid-January to early May. You’ll avoid the intense heat from June to August, the rain (and possible hurricanes) in September and October, and the crowds and high prices around Christmas.
The big caveats with those periods are spring break (March/April) and Semana Santa (the week before Easter), when American and Canadian students, and then Mexican tourists, turn out in force and prices spike temporarily.
Be aware that certain attractions are only available (or recommendable) during specific months, whether snorkeling with whale sharks  (June–September) or visiting Chichén Itzá  on the spring equinox.
Even many year-round activities like sportfishing, kiteboarding, and bird-watching are better or worse according to the season.