This is the tropics, the weather is always pleasantly warm and when to visit Krabi will depend whether you like things hot and dry or more moderate temperatures due to occasional showers during the rainy season cooling things down. While it is not impossible that you could hit it unlucky during the rainy season and see a three day tropical down pour, these are not frequent and rain mostly occur during the afternoon for about an hour or two and again during the late evening. The only two down-sides to the rainy season are rougher sea conditions which might see you having to postpone day trips to nearby islands to the next day when conditions are hopefully better. Scuba divers might also not prefer this season due to less clear under-water visibility. However, more than enough sunshine will be experienced for a great beach vacation.
January to mid April sees dry conditions with temperatures averaging 30 degrees Celsius. Mid April to end May is the hottest time with temperatures rising to a whopping 36 degrees. Thunder showers starts during this time bringing with it an increase in humidity combined with high temperatures. From June to end October the rainy season is in full swing, but there is an up-side too. Krabi hotel deals during this time is much cheaper and can in fact be half the price you would pay during January and February for example. Many hotels also offer hot deals like free nights and other enticing specials during this time. From November to end December things slowly start to dry up again. This is the shoulder season in terms of tourism. Accommodation might not be as cheap as during June to October, but still much cheaper then during January and February.