A lot of people ask me what is the best time to visit the Alhambra because it is necesary to state the time when buying the ticket. This is because the amount of people allowed to go through the Nasrid Palaces is controlled in order to avoid overcrowding. See pictures of the Nasrid Palaces here
I go to the Alhambra about 2 or 3 times a year, because I go when I am visited by family or friends.
I never seem to get bored of it.
If I have a choice I book tickets to the Nasrid palaces at about 12.30 midday.
This means that I would actually arrive at the Alhambra at about 11.30am.
Before going through the Nasrid palaces I visit the Alcazaba (the castle like bit) and wander around looking at the Albaicín.
The map on this page will help you understand the layout of the Alhambra
This means that by the time I have been to the Generalife I am developing a good appetite for a midday meal. After coming out of the Alhambra just before 2pm I either go to the Mimosa outdoor restaurant near to the entrance to the Alhambra. (It is not very good value for money but there is a pleasant place to sit)
If I am with friends on a tighter budget there is a very cheap fairly good "menu del dia" at the Guadalupe hotel.more info
A few days ago I ate at the Parador inside the Alhambra.
They have a menu del dia for 29 euros. By Granada standards this is expensive but it is cheap for an expensive restaurante if you see what I mean.
There is a pleasant courtyard where you can sit outside.click here
So my advice is to book the Alhambra tickets about 90 minutes before you want to eat.
(but you could take some sandwiches and there are pleasant places to eat them if you don't want to be controlled by your stomach)
For links to places to eat near to the entrance to the Alhambra click here
However, in July in August it is best to book as early as possible to avoid the midday heat.
There is info about how to buy the tickets here
If it appears that all tickets to the Alhambra are sold out look at this page for advice.