As befits a significant historic location, Machu Picchu has several ways of getting to it. The most famous, and one those of sufficient condition will likely want to try, is on the legendary Inca Trail. Nothing can compare to having 'earned' that view of looking down on the citadel from above on the fourth morning of the trek by hiking there.
Taking the train also has novelty value and, depending on which train you opt to take, a fair degree of romance and luxury. Then there are the alternatives to the Inca Trail - always involving a transfer from Cusco to the adventure start point and then a mix of different hiking and biking options to arrive at Machu Picchu.
Going by road the whole way, via bus or private transfer, is not an option: Machu Picchu and its nearest town Aguas Calientes are not connected to Peru's road network. You can go only to Ollantaytambo or Santa Teresa (Hidroelectrica train station) by road and then must switch to train.
See this article for an Ultimate Guide to Machu Picchu
By Private Transfer/Bus and On Foot via the Inca Trail
Duration: 4 days
For many, seeing Machu Picchu is synonymous with doing the Inca Trail which, if you are doing the classic version, starts at KM82 of the Cusco-Aguas Calientes railway line. The transfer to the start point of the hike is normally by bus, though private transfer can be arranged.
While far from the fastest way to get there, this is definitely the most popular, although you will need to have a reasonable level of fitness for the 4-day hike. Demand for doing the Inca Trail is such that available places are often booked up six months in advance! See here for a typical week-long itinerary, beginning in Lima. The trail is closed in February.
A great, less-crowded alternative to the Inca Trail is the more remote Salkantay Trek—read about how it stacks up to the Inca Trail in this article that compares the two.
By Train and Bus/On Foot
Duration: 4-4.5 hours
The perfect combination of practicality, novelty, and comfort, taking the train to Machu Picchu is a great option, and also hugely popular. It is also hugely expensive: one of the most costly rail journeys per mile in the world. Then again, seeing the Sacred Valley scenery unfold from your seat as you sip a drink is a memorable experience.
The journey starts either from Cusco's Poroy train station or, when the station is closed, from Ollantaytambo train station (to where you are transferred by bus). Some trains now also use historic San Pedro train station in Cusco which is closer to the city center as the departure point (these will nevertheless call at Poroy station too). Peru Rail and Inca Rail run a variety of services with frequent departures offering varying degrees of luxury, but note that the train runs only as far as Aguas Calientes. From here, you can either get a bus (the bus station is by the train station) or walk (challenging but beautiful).
The train from Poroy station to Aguas Calientes train station takes around 3.5 hours; it's a 30-minute bus journey from there to Machu Picchu.
See here for more on getting from Cusco to Machu Picchu by train.
By Transfer and On Foot/Cycling on an Alternative Trail
Duration: 3-5 days
Such is the popularity of the Inca Trail that operators have developed a number of alternative adventures as ways to approach Machu Picchu, with transfers from Cusco to the adventure start point included. These include the aforementioned Salkantay Trek. See this article for more on alternative treks to Machu Picchu.
By Private Transfer, Train, and Bus/On Foot
Duration: 4-4.5 hours
Taking a private transfer to either Ollantaytambo or Santa Teresa (Hidroelectrica train station) before boarding the train to Aguas Calientes does cut costs on what is a very expensive journey. At one of these stations though, you will still need to switch to train and continue your journey as per option two. Traveling this way can be as quick as traveling the whole way from Cusco by train, however. Vehicles leave Cusco for the road part of the journey constantly.