Unused wire that is stored well has a very long shelf life. The copper conductor itself does not deteriorate, and modern insulation — especially HR-FR-LSH and cross-linked (XLPE-type) compounds — stays sound for many years in the coil. In practice, quality wire kept properly will still be perfectly good long after purchase.
What shortens its life is poor storage. Direct sunlight and UV, high heat, damp or humidity, contact with oils and chemicals, and crushing or sharp bends can all harden, discolour or crack the insulation. Keep coils in a cool, dry, shaded place, off the floor, away from chemicals, and don't stack heavy loads on them. Inspect older stock for brittle or cracked insulation before use and discard anything doubtful.
Installed wiring is a different story. Under continuous load, current warms the conductor and the insulation slowly ages from that heat over decades — which is why home wiring is typically reviewed for replacement after about 25–30 years, sooner if it shows warning signs like warm switches, a burning smell or frequent tripping.