Most people visit Peru between June and September, which is the dry season in the Sierra (mountains) and the Selva (Amazon Basin), but that is by no means the only time to visit. The best time to go depends on your primary interest, or what regions you want to explore. If you prefer to avoid the crowds or the cold, consider doing your Cusco-Machu Picchu trip in late April, May, October, or November.
The seasons are flipped in the southern hemisphere, but because northern Peru is practically on the equator, "summer" and "winter" mean less in the northern half of the country than in its southern half. The dry season, from May to September, is winter in the southern Andes, where it often freezes at night, but the days are sunny. Lima is enveloped in a chilly fog called the garúa for the better part of those months. You may get some rain in the Andes in April and May, but the highland landscapes are a beautiful shade of green then, and there are fewer tourists.
The dry months are the best time to visit the Madre de Dios portion of the Amazon Basin, but you are better off visiting Iquitos and the Amazon River during the "rainy" season, because the water is high then, facilitating access to streams and lakes for wildlife-watching, and it doesn't rain that much more than during the "dry" months.
You'll want to make your reservations far in advance for travel anywhere in Peru during the second half of July or first week of August, when local school vacations add Peruvian tourists to foreign masses.
If you're a surfer and want to spend more time in Lima and the coast, or simply want a break from winter, the December-to-May southern summer is a great time to visit Peru. It may be raining in the Andes and Amazon, but the weather is lovely in Lima and such coastal sites as the Nazca Lines, Paracas, and the pre-Incan ruins near Trujillo and Chiclayo.
Fireworks and colorful processions honor the Virgen de la Candelaria during the first half of February in Puno, on Lake Titicaca. The faithful follow images of the Virgin Mary through the streets as colorful dancers depict the struggle between good and evil. (The demons always lose.)
Carnaval (February or March) is celebrated with parades and folk dancing in most highland towns, though especially in Cajamarca, Ayacucho, and Huarás.
Semana Santa (March or April) is marked by Holy Week processions countrywide, though Ayacucho's celebrations are the most elaborate.
Thousands flock to the Ausangate Glacier for Qoyllur Rit'i (June 9), a religious festival that mixes Incan and Christian rites in Sinakara, Cusco department.
Cusco's spectacular Inti Raymi (June 24) marks the winter solstice with a reenactment of an Inca ritual that beseeches the sun to return. The fortress ruins of Sacsayhuamán form the stage for that proverbial cast of thousands.
Firecrackers may rouse you out of bed during Peru's two-day Fiestas Patrias (July 28-29), which celebrate the country's independence from Spain in 1821.
Lima and the Central Highlands revere the Señor de los Milagros (October 18–28), a colonial-era, dark-skinned Christ statue that survived a 1655 earthquake that destroyed much of the capital.