Costa Rica has a tropical climate, so it has rainy and dry seasons. The rainy season starts from mid-May to the end of November, with the highest amount of rainfall between August and November. It's still good to visit the coastal and touristy areas during the early part of the low season but off the beaten track travel becomes harder. The best surfing can also be found on the Pacific coast during this time.
Dry season between December and April still sees some tropical showers but this is peak time to travel. Book your accommodation well in advance if travelling during this time.