We always recommend travelling in spring or autumn if possible, as it is extremely hot in high summer (July and August) and over 40 degrees is not uncommon.
However, it never gets really cold in Palermo. Even in January, the thermometer rarely drops below 10 degrees. From April onwards, it gets pleasantly warm and the likelihood of being able to swim on the beach is relatively high.
The most expensive time to travel is around July and August, when the whole of Italy is on summer holidays and everyone is away.