Engine oils have an expiry date which means the performance levels can no longer be guaranteed. However if your oil hasn't been opened, it'll take years and years for it to degrade. If your oil has been opened and is a couple of years out of date, it'll most likely be absolutely fine. However, if you've already opened it and it's 5 years out of date you'll be better off buying fresh oil as the additives in the oil may have oxidised and lost their qualities.