The Deutsche Bahn train between Berlin and Hamburg is frequent (every hour), fast (96 minutes) and expensive (65 €). But if you book at least three days in advance you can get a discount ticket for 29 to 49 € (if you buy online or on a ticket machine) or for 34 to 54 € (if you buy at the ticket office).
Much easier and cheaper is to take the bus. The bus takes about 3 hours and runs every hour between 07.00 and 21.00. Normal price is 25 €, Discount tariff is 19 € for departures at 07.00, 08.00, 20.00 and 21.00. You can also get a spezial discount ticket (Super-Aktions-Preis) for 9 €, if you book at least one week in advance. Tickets are available at most travel agencies. Note that some of the buses are arriving/departing at Berlin Ostbahnhof, while most are arriving/departing from Berlin ZOB. More infos under Berlin Busses.