According to the Bumble Bee company, which manufactures canned sardines, if properly stored with no damage to the can, sardines in a tin stay good for several years. Sardines do have a "Best By" date that is typically stamped on the can by the manufacturer.
Temperature fluctuations can affect the taste of canned food products, so Bumble Bee does not recommend freezing canned sardines or storing them anywhere that is subject to extremely high temperatures. Even though canned sardines stay edible for several years, the company recommends not keeping canned foods for longer than two years, as the quality of the product begins to degrade after that amount of time. Canned sardines should be removed from the can for storage after being opened.