Gifts can be given on an occasion where they are expected or unexpectedly, with the latter type sometimes being the best of all.
Where special occasions are concerned, however, gifts are sometimes traditional enough that expecting them is natural. For those occasions, it’s important to consider whether or not the date means something in particular to the recipient. If she’s not particularly taken with opulent birthday gifts, saving a big gift for a later occasion would likely be sensible and allows something more extravagant to be picked up to mark the day.
As far as when to purchase someone a gift goes, it’s really dependent upon the person themselves. Know the person you’re with. Some women find great meaning in anniversary gifts and others do not. Some do most of their celebrating on popularly-celebrated holidays and offering her a gift then could have a lot of meaning and be very much appreciated.