X-에게 마음을 주다 (give one's hear to X) is a common expression for falling for that person).
"I give you my heart to keep in your heart" migh be translated as "(당신의) 마음에 간직하도록 제 마음을 드릴게요", but it is not a common phrase. I would say it's a way of asking the person to remember you in their heart in a poetic way.
I think such things are most likely said when you part with someone, either temporarily or for good, but it's hard to say without seeing the exact sentence.