If you are running an industrial operation then you will need to replace your hens every two years because their level of productivity will decrease and you'll start to loose money feeding chickens that aren't cranking out as many eggs. That does not mean they will stop laying, just they will lay less, and often times in backyard flocks people keep at least some of their old hens because they're attached to them or still want them to have offspring or don't care they're laying less. Some breeds will probably lay longer than others but if a hen grows elderly she'll probably dry up all together eventually but this might be a number of years after her peak productivity. My eldest hen is a Serama who has broken all expectations by laying an egg every other day for about six months even though she's nearing three years of age and is of a breed not known for high productivity. Some of the people here could probably give you a better answer than mine as far as how long hens generally produce eggs. And yes, most breeds start laying eggs between 4-6 months of age, but you should definitely look up these things for your specific breeds.
I have two 7 year old Rocks. One is a barred and the other is a partridge. The barred rock is Miss Mary and she has been retired at least two years now. She still sits in the nest and fixes it up nice, but doesn't lay any eggs. She has taken up knitting and is a lovely girl, but she's starting to walk like an old lady.
The other rock, Cinnamon is the boss of all and a right bitch when she has to be. She lays only in season now, as of last year about one egg a week. She has a distinctive egg, so I know which one is hers. Over the years the color has lightened, but the shape is the same.
I had a quite a few production rocks that were laying hard and heavy last Spring, Summer and the beginning of Autumn when they started dropping like flies. They would be fine one day and dead the next. They are coming up on 4 years and I have lost 5 between September to December. They were very good dependable layers and most laid through their first winter AND their second winter with more spotty laying through their third winter. Being of production stock I can understand why they just fizzled out.
In an optimal world, if I had someone to harvest old hens for me I would do a three year rotation. Spring One raise peeps to laying, then keep them through to their third winter. In the Spring of their second winter I would get replacement peeps and raise them all for the final year. After the Spring laying, when the second peeps are coming up on one year old, I would then harvest all the old hens after they have exhausted themselves in the Spring, for me that is around June. Then you have the young ones taking over and keep rotating them that way to get that final Spring lay from the older hens. To make it easy, I would rotate the color of the chickens. White Wyandottes to begin and then a different breed or a different color. Then you don't have to try to guess between yound and old, the color lets you know who is who.
But, that is if you can harvest the whole lot for your freezer or canner.
You have to remember that no one is really breeding chickens for their longevity. They breed for early laying and hard laying for two years. Especially if you get a breeding line that is designed for commercial production. If you get your peeps from a breeder or a hatchery that is breeding for strength of breed and heritage dual purpose stock, then you have a better chance to get hens that will go a little longer, but not much. After that third Spring they will not lay enough eggs to pay for their feed and by the fourth Spring they are pretty much done laying.