First, if your wine has a cork, it should be stored sideways. When a cork-sealed bottle is upright, the cork will slowly dry out over time, allowing oxygen into the bottle and spoiling the wine. We’ve had friends lose bottles to vinegar from not realizing this key fact. If your wine has a Stelvin closure (aka a screw cap), your wine actually is safe to store upright, since you don’t need the wine touching the closure.
Secondly, keep your wine away from heat, ideally in a cool (but not cold!) place. If where you’re storing your wine is too warm, the wine will develop a “cooked” aroma, becoming flabby and losing its aromatic quality. This same idea applies if you buy wine for dinner later and throw it in the hot trunk of your car. If it’s an average-quality wine, it might be fine for a while, but we wouldn’t recommend it! At the same time, don’t store bottles of wine in the refrigerator for any longer than you need to properly chill the wine. An extreme change in heat can change the flavor of the wine and alter the pressure in the bottle, which can break the seal from the cork (maybe allowing air in). Just like other food in a smelly fridge, your wine can absorb funky “fridge” flavors over time. The best temperature is between 55°F (for fine wines) to 70°F (for more everyday wines).