I have a little experience on this. I live about 4 hours away from any kind of decent brew store, so we stocked up when we visited Northern Brewer. It generally went that the longer I waited, the worse the beer turned out. I have since refined my brewing and making sure to brew in a timely manner is one of them. I had a number of harsh batches…and I blame them on a couple things…steeping grains past 170 and the kits being old. Some of the beer mellowed with time (4+ months sitting), but I now make sure to brew everything I buy within two weeks. I drink everything I make no matter how it turns out, and I just don’t want to drink any more bad beer!
My uneducated guess would be crushed grain is good <30 days, should be pretty good <45 days, but is really pushing it past then. I would think sealed extract is good for a very long time.