It's true you can get dehydrated if you consume a lot of alcohol. Drinking booze makes you urinate more, which in turn dehydrates you. However, it's not the dehydration itself that causes a hangover. After a night of boozing, you can chug a few glasses of water and completely rehydrate yourself, yet still wake up with a splitting headache and a sour stomach. That's because several factors combine to create a hangover, mainly a drop in blood sugar (which can cause shakiness, moodiness and weakness), excess stomach irritation (stomachache, nausea and vomiting), poor sleep quality (which makes you tired) and dilated blood vessels (here comes the headache) [sources: National Public Radio, Nordqvist].
People may tell you to drink a lot of water before you start downing booze, for example, or alternate alcoholic drinks with water. Or if you forget to do that, they might advise to have a big glass of water before going to bed. Being dehydrated may cause you some lightheadedness and a sense of thirst -- so definitely do drink some water before bed and when you wake up -- but know that it's not the source of your hangover.