The hour matters more than the month
Your slot decides the visit more than the season does
In summer go early. In winter go late. In spring and autumn take what you can get.
Most pages about visiting the Alhambra stop at the month. The more useful question is what time your Nasrid slot is, because it determines everything else about the day.
Early morning — the first slots, from about half past eight. Coolest, quietest, and the light is soft on the Alcazaba. The drawback is that you are doing the palaces before you have any sense of the site, and in winter it is genuinely cold up there at that hour.
Mid-morning — the sweet spot for most people. The site has woken up, the pavilion queues have cleared, and you finish in time for a late lunch in the city.
Early afternoon — the second entry wave, around two. Busiest, and in summer the worst possible time to be in the Alcazaba. In winter it is the warmest and best-lit part of the day.
Late afternoon — the last slots. The light on the red walls is at its best and the Generalife empties out. The risk is running out of daylight in winter, when the site closes early.