The general recommendation is two years. Some separation of additives can occur in as little as one year, so "shake well before using".
If the conainer is kept away from heat and sunlight the shelf life can be much longer. A gallon of oil won't last one year if you follow the "6 months or 5,000 miles" schedule (I know, not official, but practical and sufficient). Even a five-gallon pail should not go past it's realistic shelf life if stored properly.