It depends on the breed and on the individual, and on your expectations. As a hen ages, she just lays less and less. Some people don't mind getting only a couple eggs a week, for example if the hens are more pets anyway, whereas others can't justify the expense. Myself, I'm happy with an egg every other day, but once it drops below that I usually cull. Usually by this point they are about 3 years old, although if a hen continues to lay well past that age I'll keep her indefinitely.
Incidently, don't let anyone tell you that old hens aren't good eating! Actually, they are the best for eating. Historically, this was the most common chicken eaten. The meat is more flavorful and the stock superior to any other bird. Try it and see! Don't grill 'em or something though--put that girl in a big pot, cover with water, add a splash of vinegar (apple cider or white), and turn that heat on gently, heat it up slow, and DO NOT let it boil. Keep it on a nice low simmer for at least several hours, preferably all day, then cool, strain, pick the meat off and enjoy your stock and tender, succulent meat! Aging for a couple of days in the fridge before cooking makes them even more tender. Crockpot works too btw. Be sure to include the cleaned, peeled feet too in your stock pot, that's the secret to the richest, most nutritious stock. (PM me if you want instructions on cleaning the feet for use, there's a little trick to it). If you have a nice fat old hen (and some of them are) trim off the extra fat, save the belly fat too, and render that stuff in a skillet and keep it in your fridge. You can use it to saute stuff, or make matzo balls. Have fun!