There will be two entries for hydration - this is the short story, and the next entry will include lots more information. Hydration is a more complex topic than you might expect, is it is about water and electrolytes, mainly salt.
Fellrnr's Hydration Guidelines
When you are thirsty, drink. If you are not thirsty, don't drink.
If salty things (potato chips, etc) appeal, eat salty things or drink with electrolytes. If salty things (or the thought of salty things) are nauseating, drink water.
Don't drink to make the suffering of a race less - if you're not thirsty, drinking won't help your misery. Don't drink a fixed amount; let your thirst guide you. But if you're thirsty, don't skip drinking to make up time; unless you are very close to the finish, you'll end up slower.
For extra information on your hydration, weigh yourself before and after you run; the difference between the two numbers will be changes in hydration. If your weight has dropped 0-2%, you're probably hydrating okay. If your weight has dropped much more than 2%, you may need more fluids. If your weight has gone up, you probably need more salt.
Further suggestions, based on anecdotal evidence and personal experience: If your hands swell up, or you find your skin becoming puffy, you probably need more salt. If you find that after running, you are thirsty, but everything you drink seems to go straight through you without quenching your thirst, you probably need more salt.
Don't start your run thirsty - it is better to hydrate before you start than to try to 'catch up' on the run. However, drinking lots of water before a run without plenty of electrolytes is a bad thing. This practice can flush out electrolytes, creating a problem ahead of time.
What to drink?
Drinking water without consuming salt is not a good idea. For shorter runs, salty snacks after the run may be sufficient. For longer runs, you need to consume salt during the run. I drink water with 1/4 tsp of salt per quart as a cheap solution. Many people use a sports drink or electrolyte capsules on longer runs. I dislike electrolyte capsules, partly because I struggle to swallow them, but also because they bypass the sense of taste. Our taste for salty things reflects our sodium balance.
I am not going to cover sports drinks or the addition of fuel (carbohydrates, protein, even fat) to your drinks; that is a larger topic and does not have any direct bearing on hydration. The only caveat is to make sure your drink does not make you nauseous, as that will have some obvious impact on hydration! A drink that does not taste good will also discourage drinking, which can lead to dehydration; make sure you like the flavor.
I'm also intentionally ignoring electrolytes other than salt (sodium); they are important, but generally not critical in the short term. As mentioned earlier, I often add a pinch of 'no salt' (potassium chloride) to my drink to give me a bit of potassium. Eating a nutritious diet is important to get a variety of micronutrients. (Bananas have a lot of potassium, but potatoes have more.) Magnesium requires a blog entry of its own.
The Fellrnr Drinks
Pre-run - 24-32 oz of fluid with 1/4 tsp salt about an hour before the run. This gives my body a chance to keep or flush out the fluids and electrolytes. (I also take a pinch of potassium salt ('No Salt') and a magnesium supplement before the run.)
For training runs where I don't need extra calories, I drink add 1/4 tsp salt, plus a pinch of 'no salt' to each quart of water. This tastes a little odd, like very soft water.
For races, or training runs where I want extra calories, I use Gatorade with the same extra 1/4 tsp salt, plus a pinch of 'no salt' to each quart. This makes the Gatorade taste very strong - try it before you run with it.
Reminder - As always, I suggest you do your own research and make your own decisions, taking what I write as one source of input.