Edinburgh's is an all year round city. Its main tourist period is from April to September, with the height of its 'season' during the school holidays in July and August, when all accommodation, from campsites to 5 star luxury hotels, is at a premium.
Edinburgh becomes almost impossibly crowded during the edinburgh festival period in August, so book well ahead if you want to go to the festival, and avoid August if you don't.
Statistically (see our edinburgh climate page), your best chances of fine weather are in May, June and September. July and August are usually warmer, but they are also wetter.
Being closer to the north pole than London, during summer daylight hours are long. The midsummer sun sets around 11pm in the Shetland Islands and even in Edinburgh evenings seem to last forever in June and July. Conversely, in December the sun doesn't seem to come up until late or to stay around for very long.