I use whirlfloc in pretty much every brew apart from some wheats where the protein haze is part of the style. Shelf life is about 2 years (see below.)
Even though the recipe calls for whirlfloc, you can use either whirlfloc or irish moss, both are kettle finings and contain the same active ingredient - kapa-carrageenan (Wikipedia lists other types and surprising uses.) I do 10 gallons mostly, so 1 whirlfloc tablet is the right dosage. When doing 5 gallons, I prefer the moss, since 1/2 tsp is easier to get than having to mess about with cutting whirlfloc tablets in half.
Irish moss has a shelf life of several years. (See related question Does Irish Moss Expire?). Given that whirlfloc is powdered, with a greater surface area, the shelf life can be expected to be reduced. I can't find the actual MSDS, but a reference is here:
In unopened original Kerry Bio-Science packaging, WHIRLFLOC BWS has a
shelf-life of 24 months from date of manufacture.
That's describing the sand-like powered form of whirlfloc. The compressed tablets I would guess kept in an opened, but airtight bag, would last about as long (tablet form reduces surface area, increasing shelf life, but the opened bag counter-acting that.) So, 2 years shelf-life seems reasonable.
(fwiw, I've just ordered a bag of 25 - I brew once a month, so that's a 2 year supply.)
EDIT: Here's a picture of how clear the wort will be after a good boil and kettle finings.
![enter image description here](https://i.stack.imgur.com/81yxt.jpg)