Should I buy a ticket to Cusco in advance or can I get them at the airport once I land?
I don't know if there are advantages or disadvantages of booking prior but we had sown a week in Rio and a night in Chile prior to heading to Peru so we went through a travel agent to assure no mistakes or hiccups with our travel itinerary.
Guess it would depend on how many connecting flights etc you have before getting to Cusco.
Always safest to buy in advance especially if during busy season.
Assuming your question is related to flight from LIM - CUS. There are a lot of flight options and airlines that fly the route. It is much like the US the flight prices tend to vary a lot. Advance booking is highly recommended, I paid less than $100 roundtrip on Avianca airlines.
If you're travelling on a budget, it's better to buy your tickets in advance because over there, tickets are a lot more expensive.
If you prefer to "go with the flow", just making a decision when you arrive in Peru and money isn't a problem you can buy them there.
Get an answer from Hotel La Cabana Machu Picchu staff and past guests.