According to Foodsafety.gov, white flour can be kept for 6-8 months in the pantry after opening, or 1 year in the fridge. I recommend keeping flour in mason jars in the pantry or in the freezer to keep pests out in warmer months. Whole wheat flour lasts only 3-6 months in the pantry, or 6-8 months in the fridge.