How long can a plastic bottle of water be safe to drink?
Longer than you will live.
2-5 years if stored in a cool dry place. Shorter amount of time if it's been in the sun. There are no bacterial concerns but the sun's UV rays start to break the plastic down leading to plastic contamination in the water.
Factory sealed? Almost forever. Your own reusable plastic bottle, filled with tap water, will probably start tasting funny after a couple of days. How long it's safe will depend on how clean it was to begin with.
One million years.