A lot of dating advice, particularly advice geared on "getting the girl" in the first place is very clear on not surprising women with gifts or using other behavior of that nature. I generally agree with this logic. Gift buying is needy behavior that suggests to women that they are too good for you and/or that you are desperate. However, there is a time and place for gifts. When should you start considering buying gifts, and what are good ways to do it? Here's my take:
No gifts before sex
Unless it is a very unusual situation or you guys are very young and not sexually active yet, do not buy any gifts until you have sex. Note, this does not mean not paying for the bill at a restaurant or another date (I generally recommend paying for dates, at least early ones). What this "rule" means is do not surprise her with flowers, buy her a present, don't record her a song on the guitar, or do anything you see in Hollywood. Why is sex the crucial point? Because until sex, for the most part you are still in "courtship" and not in "dating" or "relationship".
Ideally line up first ever gifts with a gift giving time
Once you have had sex with a girl, the neediness dynamics have changed. You have attracted her for the most part and you are past a large (if not the entire) part of courtship. You have much less to worry about in terms of appearing needy or desperate as this is mostly an issue during courtship. With that said, it is a bit dangerous to set a precedent of being a gift giver early on in a relationship. The best way to open up with gifts is waiting for a time where people expect gifts, such as the holidays or birthdays. This will make it difficult to infer much about your gift giving habits and make it harder for her to have any expectations.
Be unpredictable with gift giving.
When you give a gift, the key should be to maximize the emotional response from the gift. Often times, the response is less of a function of what you buy but when you buy it and what expectations are. If you surprise your significant other from time to time with gifts as opposed to buying gifts in a predictable manner, you will get much more bang for your buck and time. Personally, I rarely ever give gifts which makes a gift almost always 'unpredictable' and hence very powerful.
If she is unhappy about a gift...
Sometimes, we come up with a gift and our significant other is unhappy about it. What should you do? If this happens, the solution is to adjust your gift giving so expectations are lowered. A gift is exactly that, a gift, something extra. It should always be appreciated, if it isn't, start giving less gifts (or stop altogether).
At the end of the day, gift giving is very personal and subjective. I prefer to err on the side of less gifts so that when I buy one it is meaningful, but that may not work for everyone. What is most important is to understand that a gift has little to NO place in courtship. We are in the 21st Century, not the 16th Century.