Cuba is blessed with great weather. The weather is quite mild and pleasant throughout the year so you can travel to it almost at any time. Here is a rough guide to the weather:
Winter: The winter months are actually quite warm so winter is not a bad time to visit either. The weather is not harsh and quite pleasant. If you are not a huge fan of the sunny shores, winter might be the ideal time to go.
Summer: Summer is perhaps the best time to visit and also the peak tourist season. The sunny days suit an idyllic beach holiday. But there will be a considerable amount of crowds during this time as well.
Hurricane Season: Cuba is known to have the occasional hurricane. For hurricane threats, September and October are the worst months. So if you are worried avoid these two months.