For hatchery stock (about 85% of all the chickens out there) people usually replace their flock at 2-3 years of age. Sometimes even the following spring.
For non-hatchery, show quality, heritage, etc type chickens - Replacement happens, in good birds, at 5+ years of age. A lot of people have productive hens at well beyond 7 years old, and worthy roosters at 6 years, sometimes more.
My hatchery layer flock will probably be replaced as soon as this coming summer ends, but my non-hatchery girls and boys will only be replaced by better quality birds or when they truly get old, probably in 8 years from now.
Some old breeds like Gamefowl and the original Quechua can live up to 20 years and still be worth it.