There is not a bad time to visit Machu Picchu; after all it is one of the World’s New Seven Wonders of, a UNESCO World Heritage Site and is one of the most beautiful places in the world! However, depending on your preference, the weather might be something worth considering.
There are two distinct weather seasons which affect Machu Picchu, the dry season from (roughly) April – October, and the wet season from November – March.
During the dry season you can expect bright sunny days with an average daytime temperature of around 19 °C (66 °F). During the night time / evenings temperatures can drop significantly to around freezing, especially during the months of May to August (wintertime in the Southern Hemisphere). During the latter months of the dry season, the grassy terraces of Machu Picchu are also more arid and brown due to the lack of rain.
During the wet season you can expect plenty of rain for sure, statistically with the months of December – February being the worst. Rain usually comes in heavy bursts during the afternoons, but you should be prepared for rain at any time of the day. Unfortunately at Machu Picchu there are not many sheltered spots where you can seek protection from the rain, so be prepared with a good poncho and an umbrella. Average day time temperatures are similar to the dry season around 19 °C (66 °F), but the night time remains quite warm 8 °C (47 °F).
If you are planning on hiking Huayna Picchu, then be aware that low cloud in the mornings can affect Machu Picchu at any time of the year, but more so during the wet season.
Hotel availability in Aguas Calientes is better during the wet season, but even so, the very best hotels still reach capacity.