October and November are the best months — the monsoon has cleared, the air is relatively clean, and the Himalayan views from the valley rim are at their sharpest. The post-monsoon sky has a quality of light unique to the season. This is also peak trekking season, so the city fills with trekkers and prices rise accordingly.
March to May (spring) is the second best period: flowering rhododendrons on the valley slopes, reasonable weather, and the other peak trekking window. June to September is the monsoon, bringing heavy rain, poor visibility, and sticky heat; sightseeing is still possible but conditions are not ideal.
December to February is cold — temperatures can drop to near freezing at night — but clear and much quieter than peak season. Swayambhunath and the mountain viewpoints are at their most dramatic in sharp winter light.
Major festivals worth timing a visit around: Dashain (September–October, Nepal's most important festival), Tihar (October–November, festival of lights), Maha Shivaratri (February–March, hundreds of thousands of pilgrims at Pashupatinath), and Indra Jatra (August–September, the Kumari chariot procession in Durbar Square).