Sri Lanka is a tropical island, which has both dry and wet seasons. While the sun shines continuously year-round, there are two monsoons that hit the island every year. The South-Western monsoon, which visits the coastal areas (where most of the beach resorts are located) from the end of May to October, while the North and East monsoon is around from October to January. This is not to say it will rain throughout your stay, but the rains will come periodically throughout the day lasting from 1 minute to a few hours.
Colombo and the rest of the low-lying coast have an average temperature of 27C, Kandy averages at 20C, and Nuwara Eliya at 16C..