How long to keep hens, you ask, it all depends on the breed, the feeds and the purpose.
From all my reading, I have found info about different breeds of chickens.THe high production girls give it their all and after a couple years poop out; though I really wonder if its a total quit or a reduction to the production of the average hen.
There's also the cost of feeding per egg way of accessing production and value; some breeds of chickens spend most of their time foraging and give loads of eggs in return for little money put into feed. So they may produce more eggs in a long lifetime than a production red in 2 years.
Favorites. My boys are already asking to keep certain special birds until old age. Special hens are named and coddled and doomed to endure handling as if a cherished doll.
THese girls actually enjoy the attention.
And there is the unexpected demise, from illness, injury or predation. THese factors are unpredictable yet effect how long to keep a hen.
I usually plan to keep a production animal longer as they add value to a breeding program adding good health genes, they know the places of safety and they sense danger quicker; where to find the water and food. And show the young ones these things, too.
How long to keep hens? Sorry, you got my long winded answer. No one answer.