This varies tremendously as there are no absolutes, and there are a lot of different theories depending on which expert you listen to.  A rough but simple rule of thumb:  any Port with a driven cork (you need a corkscrew to extract it) should be consumed within a day or two to enjoy it at its finest, but any Port with a T-stopper type cork (can be removed by hand and easily replaced in the bottle) can generally be kept, securely re-corked in the fridge or a cellar, for a few weeks without significant deterioration.  Below you will find more specific recommendations for each style of Port.