What breed are we talking about? They will begin to lay less, but I have read that they decrease after 2 years old and start being where you would notice a good deal less by 3 years old. After that, it might be good to let them go broody and replace them with their own offspring. I never kept a hen past 4 years old, but my mom-n-law kept some for 7 years and wouldn't consider killing them, because she said that even though they aren't good layers anymore, she still gets a few eggs a day and she didn't want to start over with new chicks.
I would keep a good broody for 7, if she looked healthy, but a hen I wanted for egg production, I would replace after 3 or 4 years. I would first raise a few young pullets to where they were about 10 to 15 weeks old and then I would start eating a few soups (thats all you can do with an old hen ). That is unless I have a section I can pasture them on, alone where they can live mainly on grass and bugs, with just small rations of cracked corn here and there. Then maybe I can squeeze blood from a turnip just a bit. I mean, I will agree that it would be disappointed to be cleaning a soup hen and find an egg or 2 and know thats it from her.
My mom was always trying to convince me to replace my flock every year, but really they are supposed to peak between 1.5 and 2 years old.