Machu Picchu is the reason many people come to Peru in the first place. It is a once in a lifetime experience but it also requires a fair bit of planning ahead. Hopefully this helps.
“Shrouded by mist and surrounded by lush vegetation and steep escarpments, the sprawling Inca citadel of Machu Picchu lives up to every expectation. In a spectacular location, it’s the most famous archaeological site on the continent, a must for all visitors to Peru. Like the Mona Lisa or the pyramids, it has been seared into our collective consciousness, though nothing can diminish the thrill of being here. This awe-inspiring ancient city was never revealed to the conquering Spaniards and was virtually forgotten until the early part of the 20th century.” – Lonely Planet
To trek or not to trek? These two posts cover in depth the various options you have to get to the famous ruins. No matter what you decide you will end up in the nearby town of Aguascalientes.
You’ll just need to stay the night before you go to Machu Picchu, there is no real reason to stay any longer. You can easily head back to Cusco in the same afternoon. It is possible but very inadvisable to do it in a day trip from Cusco. You won’t have the time or the energy to be able to enjoy or take in anything.