Hi Adam, a few tips for the Alhambra:
Yes, you must purchase tickets ahead of time to reserve your time for the palace rooms, tickets sell out in the summer, so buy a few days ahead of time...
I would try to get my time for the palace as early as possible before the tour buses arrive, and then spend the rest of the day strolling the grounds...mind you, it will be crowded no matter what time of day you go, but at least you will have gotten the scheduled part of the tour out of the way if you go early, and the possiblity of 100 less people isn't bad either...
And plan on about 5-6 hours to really see everything, stroll casually, and take in the vistas!!
Have fun, and don't forget to view the Alhambra from the Mirador de San Nicolas in the Albaicin, it is truly breathtaking!!!