There are a few factors that can contribute to fence longevity: materials used, style of fence, climate, use/abuse, and upkeep/maintenance.
However, in general, the following are broad estimates:
Wood fencing: Spruce (4-7 years), Pine (5-12 years), Cedar (15-30 years)
Metal Fences: such as chain link or wrought iron can last for decades
Vinyl/PVC: largely impervious to weather these can last upwards of 30+ years