If you keep the pellets in a cool, dry place, they should be alright for a little over 4 months. It isn't ideal...ideally it would be best to have fresh pellets every two to four weeks.
Hay will last quite awhile longer than pellets as long as it is a cool, dry, dark place and does not mold. It will dry out over time, that doesn't make it bad to use - the chins just may not want to eat it if it isn't fresh enough for their liking.