Peru’s high season for travel coincides with the driest months: May through October, with by far the greatest number of visitors in July and August. May and September are particularly fine months to visit much of the country. Airlines and hotels also consider the period from mid-December through mid-January as peak season.
From June to September in the highlands, days are clear and often spectacularly sunny, with chilly or downright cold night, especially at high elevations. For trekking in the mountains, including the Inca Trail, there are by far the best months. This is also the best time of year to visit the Amazon basin. Mosquitos are fewer and many fauna stay close to the rivers,
Note that Peruvians travel in huge numbers around July 28th, the national holiday, and finding accommodations in popular destinations around this time can be difficult.
Remember: tours to Machu Picchu happen all year round but the Inca Trail is closed in February each year.