Quote: When they stop mating depends a lot on health, and genetics. Nobody can say exactly when they stop mating or being able to fertilize eggs because this varies to such a massive extent between individuals and breeds.
Health is tied in with genetics, diet, environmental factors, etc, so breed and strain, etc have a major influence.
Some roosters have proven fertile in their teenage years and twenties, but most don't get that old, and in general by the ages centrarchid mentioned they're winding down. Most poultry average around 8 to 12 years of life if left to age, but commercial breeds are usually culled far sooner, and even if not culled tend not to live long.
As for whether their sexual drive runs faster or slower based on nutrient intake: that's a complex question. The answer is both yes and no, depending on the circumstances.
A healthy young (or old) animal is far more inclined to mate than a sick young (or old) animal. The term 'sickness' covers malnutrition too. Some diseases of malnutrition are caused by over-nutrition. Underweight animals are more likely to breed than overweight ones, generally. An animal can be underweight because it's receiving too much of a certain nutrient, or overweight because it's not receiving enough of a certain nutrient, as counter-intuitive as that sounds. The diseases of malnutrition can leave them looking normal, or cause obesity or obvious emaciation, but in general underfed animals live a lot longer than overfed ones, and breed longer. Some forms of malnutrition trigger population reduction/control instincts, and others can trigger population propagation instincts, so some types of illness (over- or under-nutrition, aka the diseases of malnutrition) can cause lower or higher reproductive drives. Often those most desperate to breed are the very animals that ought not to breed at that time, or even at all, ever.
You cannot get out of them later what never went into them in the first place, and this is one thing that has a lot to do with reliably estimating what time infertility is likely to develop. Raise them as healthily as possible, and you can expect long and productive lives... Cut corners and you can usually count on early debility and death. It also helps to not use intensive production strains if you want long-lived, long-fertile birds. A rooster raised on chick crumble and layer feed, caged, won't go too far as compared to one raised on some seeds and grains, insects, greens, etc and freeranging. But an intensive production bird won't go far even when given the extra-rich lifestyle and feed.
4 or 5 years is old for a high production breed but in the prime of life for pretty much any other breed. So yes, a rooster of a high production breed (possessing genetics for high production of meat/eggs) could well be entering early senility and sterility by the mere age of 5. But I think probably the majority of all other breeds would still be very fertile at those ages, and for years to come.
Off-topic, I personally don't get any quality offspring from hens and roosters under a year old. They might look good, but when compared to the latter clutches from the same parents, had when older, the second clutch always outdoes the first by miles, in every way. Also, older birds produce poorer offspring. Too old, too young, no good, middle aged is best, and the same seems true for canines, felines, equines, ovines, caprines, etc. Crossing a too-old bird with a too-young bird won't cancel the negatives out or equalize them, either. My experiences there agree with Centrarchid --- two years old is when they begin to enter their prime.