You'll get varying answers on this one. Generally one month seems to be the consensus.
Of course, you'll want to keep them in an airtight bag or container, and in a cool environment. Some folks prefer the fridge or freezer. If you go that route, take steps to ensure the grains don't pick up flavors from other foods.