The rule of thumb (per Kodak) is six months in full bottles. It's half that, if I recall correctly, for partially full bottles but the emptier the bottle, the shorter the life.
If you don't use a lot, you might want to consider buying the bulk ingredients to make your own D-76. It's not that hard, and then you can make as little or as much D-76 as you like, still getting economies of scale by buying reasonable quantities of the raw ingredients, which keep for years.