The question of how long drinking water will keep can only be answered by knowing what type of water was stored and how it was stored. There is a difference between commercially bottled water and water from a public water supply you store yourself.
Most commercially bottled water will have an expiration date. Even if no expiration date is provided, the shelf life should be approximately one year. For water that comes from your faucet, pumped there by a municipal water source and stored in plastic containers, the water should be replaced every six months.
The storage container and the storage containers are factors that determine the length of time stored water will remain good. All water should be stored in containers made of food-grade plastic or designed specifically for the storage of water. Most containers will have embossed somewhere on the outside "HDPE" or "PP," or a recycle triangle with the numbers "1" or "2" inside the triangle. But not all "HDPE" with the "2" triangle is food grade. That's why it is best to use containers that have contained food or drink previously, such as soda bottles, milk bottles or containers designated as specifically for storing water. Ideally, a 2-liter soda bottle will store water better than a reused milk jug. The plastic in the milk jug-type bottles tends to break down over time, leeching plastic into the water.
If you fill bottles with tap water from a municipal water source, there is usually enough chlorine in the water to keep it safe for six months or longer. If you are filling bottles with water from a well, add one or two drops of plain, unscented bleach to each bottle.
Storing the water in temperatures of 35 to 50 degrees F will extend the shelf life, while freezing the water will help it last almost indefinitely. Make sure you leave about 2 inches of air space at the top of the bottle to allow for the water to expand as it freezes. Even if water has been stored for longer than the recommended time, as long as it has been stored out of direct sunlight to prevent algae growth, it can still save your life. It just might not taste that good. Pouring such water back and forth between two jugs will aerate it by infusing oxygen back into the water. This will usually improve the taste of "flat" water.