That's a great question. Scientific research and observation by running store professional that I have read indicates a definite loss as little as within 6 months of production.
Personally I found a one or two year old unused running shoe stored in a closet to be indistinguishable from a much more recent shoe. I wouldn't go much past two years. If you look at foam under a microscope you will see it is actually lots of little bubbles filled with air. Over time, just sitting in a closet, the walls of the bubbles weaken. When pressure is applied, like in running, the bubbles burst. What this means is you'll have an almost unworn shoe that is completely unsuitable, and probably not enjoyable, for the demands of running.