Hamburg has excellent hotels, and standards are generally high across all budgets; even basic accommodation will likely be clean and comfortable. Reservations are a good idea between June and September, and around major public holidays and festivals. The city is big, and although it's easy to get from one area to another, consider where you'll be spending most of your time before you decide where to stay.
By German standards, Hamburg has a fairly standard variety of accommodation genres. These are the main ones:
Hotels Range from mom-and-pop joints to restored castles and international chains.
Hostels Both indie hostels and those belonging to Hostelling International are plentiful.
Pensionen The German version of B&Bs is prevalent in rural areas and good value.