You should always feed your animals as fresh as possible. I did, however, keep some layer feed after my first (and only) white leghorn died, and I fed it to my current hen, before I re-supplied, about a year later. I DID give it a really good sniff test, AND there wasn't much left. (If there had been a lot, I would have found another use--garden, perhaps?)
It may depend upon HOW you store it. Many types of animal feed will store fine unless the storage container gets humid. It that happens the food will mold and can become highly toxic. I keep extruded grain w/molasses for my horses and I try to stock up on it, so I'm not always running to the feed store. I keep ALL of my animal feed in metal trash cans in my barn, in a separate room (to keep my animals from "free ranging." These cans will keep out mice, but not rats.
Don't store in plastic containers UNLESS it's in the house. Originally, I had my horses at someone else's place and stored their grain in plastic cans. Soon they had lots of little holes in them, just like bags of feed will if you store them stacked in a garage. Mice can contaminate the feed with lots of nasty things that won't help your flock.
On the other hand, I had some cracked corn that had kept for over 6 months fine UNTIL we had about a month of heavy rain. It all molded and I threw it out.
BTW, my horses LOVE any excess chicken feed that they happen to find. If it's near a stall, they believe that I put it there for them, and then, they thank me for it.