The best time is October to March, when temperatures sit between 10 and 25°C and the air is at least somewhat clearer. December and January can be cold and foggy in the early mornings — early-morning fog at the Taj can ruin a sunrise visit, so check forecasts.
April and May bring relentless heat, often 40–45°C; monuments are best in the early morning before they become unbearable. The monsoon breaks in late June or early July and lasts through September: hot, humid, and rainy, but considerably greener and less crowded. The Taj after a monsoon shower, with the marble streaked dark by rain, is a sight in itself.
Air quality is poor in Agra all year and worst from October to February when the north Indian smog season peaks. Bring a mask if you are sensitive to pollution.
The Taj Mahotsav, a ten-day festival of crafts, music and food, is held in February at Shilpgram near the Taj East Gate and is worth catching if you are in town.