Port wine is aged and stored in cellars for three main reasons: temperature, humidity and light. It is cool in the cellar - around 15oC - and the temperature does not vary from day to day or even from season to season. This stability is very important. It is also crucial to keep port away from sunlight that can change the structure of the wine through the glass.

Before opening, port wine should be stored in a cool place out of direct sunlight.Store ports with cork stoppers standing up.
Ports with corks are stored lying down, with the label up.

By storing with the label up, you can identify the port without disturbing the bottle. More important, however, any sediment in the port collects in the lowest part of the bottle. When you pick the wine up, carry and decant it, you should hold the bottle in the same position with the label up. That way the sediment will stay in the same place and you can pour the port off it more easily.

After opening, ports should be kept in a cool place out of strong light. Ports with stoppers can be kept for up to a couple of months. These are usually the fruitier Ruby ports and tawnies. Ports with corks should be consumed much more quickly.
Generally speaking the older the port, the more quickly it should be consumed. Vintage and Single Quinta Vintages, for instance, should be consumed within 24 hours of opening. Otherwise the flavour might be changed, oxidation takes over, complexity disappears and the wine becomes flat.