When a wine goes bad (“turns”), it is due to several possible factors. Possible reasons include oxidation, bacterial spoilage, or simple age. There may be noticeable off-aromas or flavors (or both). The wine may begin to re-ferment, and may be completely undrinkable.
As a wine ages in its bottle, minute amounts of air seep into the bottle through the cork. Rubber corks and metal screw caps can prevent this, but can create other possible problems of their own.
If a wine bottle is stored on its side, the cork will not dry out, and this can prevent spoilage. Wine bottles that are stored upright will tend to see their corks dry out, and that can lead to oxidation.
Storing wine in a cool, dark place, with a relatively stable temperature and humidity throughout the year, can prevent fluctuations in the air pressure in the bottle, which also can prevent spoilage issues.
Generally speaking, most red wines peak in quality at around 8-10 years of bottling, and then begin to slowly diminish. Most white wines don’t improve much once bottled, and will generally keep for 6-8 years before losing their luster.