There is no shortage of accommodation options in Agra, no matter what your budget.
If you want a luxurious experiences, you would find some of the finest hotels in the world in Agra. The area near Taj Mahal is dotted with numerous five star hotels, some of them designed with traditional Indian architecture, making them look like an old palace or haveli from the days of the Mughals. Others are ultra-modern hotels with state of the art facilities and luxuries. The Oberoi Amarvilas is one of the famous 5-star hotels in Agra - for 40,000 INR a night, you get to have a moonlit view of the Taj from your room's balcony. Despite the high price tag, most of the rooms at these hotels are booked in advance.
But if you don't want to spend so much on your stay, fret not - Agra has numerous hotels in all budget categories. Tajganj is an area near the Taj Mahal where tourists typically find it convenient to stay, specially if you are planning to visit Taj early morning. There are also a few hostels in Agra - Zostel being the most popular one and the one most conveniently located.
If you are visiting during the peak season, booking in advance is recommended, however during the off-season you can easily just reach Agra and find a room in Tajganj.