There is only one hotel at Machu Picchu itself and that is the Machu Picchu Sanctuary Lodge. It will cost you to stay there no doubt, as it's an exclusive property owned by the Belmond Company, the same people that operate PeruRail, but it's also the only place you can sit in a Jacuzzi and look at the Inca city long after the crowds have left. In Aguas Calientes you'll find many hostels and cheaper hotels lining the railroad tracks—that's not as down-at-the-heels as it first sounds: many rooms have great waterfront views. Aguas Calientes' budget lodgings are utilitarian places to lay your head, with a bed, a table, a bathroom, and little else. A handful of hotels offer surprising luxury for such an isolated location. Their rates can be shockingly luxurious, too.
Not even the top luxury hotels can meet their guests inside the train station anymore. They and all other hotels will meet you just outside the front gate and help you to and from the station with your bags. Lodgings keep surprisingly early checkout times. (Hotels free up the rooms for mid-morning Cusco–Ollantaytambo–Machu Picchu trains.) Expect to vacate by 9 am, unless you are in one of the more expensive lodging choices, though this is less strictly enforced in the off season. All hotels will hold your luggage if you're not leaving town until later in the day.
Many hotels keep the same official rates year-round, but unofficially discount rates during the off season of mid-September through May. It also pays to check the hotel website, if they have one, for current promotions.