Water in an open container can start going algae in about a week.
If you go to a store and buy purified drinking water in plastic jugs you can that is sealed up you can store it indefinitely.
The container you use needs to be made from a food grade material in order to avoid leaching problems. Glass, stainless steel and some plastics are food grade.source
...
In the long run...
Several alert readers pointed out that plastic milk jugs might not be the very best container for long-term storage because they degrade and tend to leak after a year or two. Most of these readers recommend plastic soda bottles or large 5-gallon containers specifically intended for water storage.
To keep water fresh and fit for human use, it is a good practice to rotate water supplies every 2 to 4 months.source