Standard situation
Your standard use-case is
Ich würde ihr gerne xxxxxxxx schenken.
As in
Ich würde ihr gerne einen Blumenstrauß schenken.
Ich würde ihr gerne mehr Aufmerksamkeit schenken.
Ich würde ihr gerne reinen Wein einschenken.
The other word order you suggest ("ich würde gerne ihr...") is wrong in this standard situation, "wrong" meaning: the sentence is still comprehensible in its original meaning, but native speakers feel that something is wrong in the word order. You may say it is not a well-formed sentence.
Altered word order for emphasis
However, as several commenters correctly mentioned, there is one particular situation when Ich würde gerne ihr einen Blumenstrauß schenken is a well-formed sentence anyway. That's when the intention of the speaker is to put strong emphasis on ihr (as opposed to somebody else):
A: "Willst du den Blumenstrauß ihr schenken oder ihm?" B: "Ich würde gerne ihr den Blumenstrauß schenken. Und ihm vielleicht eine Flasche Wein."
This does of course only work when there is the appropriate context. In isolated sentences, this word order simply sounds wrong.
Playing with words
Just for the joy of it you can try and find some other situations where your second word order is applicable too:
Ich würde gerne ihr Piano meinem Nachbarn schenken.
This is of course rather a joke because here, ihr is used as possessive pronoun (so we alter the inner structure of the sentence), and in terms of meaning: it is not accepted behaviour to give away things that you do not own. To make this sentence realistic you have to come up with a very specific scenario. Say, your aunt has died and you have to break up her household, and your idea is to leave the piano to your neighbour, then something like this is possible: Meine Tante ist gestorben. Ich möchte gerne ihr Piano meinem Nachbarn schenken.)
Based on this, commenter Panta rei suggested simpler examples for gerne ihr word order.
Ich würde gerne ihr Haar schneiden.
Ich würde gerne ihr Hemd bügeln.
Ich würde gerne ihr Ohr abnuckeln.
However, these do not conclude with schenken which was, somehow, the presupposed structure to play with.