All-Purpose White Flour
All-purpose white flour is the most shelf-stable of the common flour varieties and the one most likely to still be in usable condition after a year or more in the pantry. Stored in its original packaging in a cool, dry cupboard, all-purpose flour typically stays fresh and performs well in baking for 6 to 12 months from the purchase date. In an airtight container at room temperature, it can remain in good condition for up to a year. Stored in the refrigerator, it can last 1 to 2 years. Stored in the freezer in a well-sealed airtight container, white flour can remain usable for 2 years or longer. A bag of all-purpose flour that is 3 years old at room temperature is almost certainly past its prime quality-wise, but whether it is still acceptable depends heavily on how it was stored — and a thorough smell and visual inspection will tell you more than the date on the bag.
Whole Wheat Flour
Whole wheat flour has a significantly shorter shelf life than white flour due to its higher oil content from the retained bran and germ. At room temperature in a pantry, whole wheat flour is best used within 3 to 6 months of purchase. In the refrigerator, it can last 6 to 8 months. In the freezer, properly sealed, it can remain in good condition for up to a year. Whole wheat flour stored at room temperature for longer than 6 months is very likely to have developed some degree of rancidity — the oils in the germ have had ample time to oxidize. The resulting flour will not necessarily make you ill, but the bitter, unpleasant flavor it imparts to baked goods is very noticeable and will significantly diminish the quality of whatever you make with it.
Bread Flour
Bread flour, which is a high-protein refined white flour, has a shelf life similar to all-purpose flour — approximately 4 to 6 months in the pantry and longer when stored in the refrigerator or freezer. Its higher protein content compared to all-purpose flour does not significantly affect its shelf life under normal storage conditions.