If you leave it with her, keep a copy of the make (and/or importer), model, type of action, and serial number in a safe place. A Polaroid or a photograph on a computer disk is also a good idea.
So say in a "worst case scenerio", you two break up & she refuses to return the gun, you can file a Stolen Firearms Report with the local P.D. (Some officers may contend that it is a civil matter, but you can go to their superiors and demand that your information be entered in the NCIC Database. Warn them of the liability of having a firearm floating "out there" and that it will be their fault if it is used in a crime, then demand their names & employee numbers to give if it is ever traced back to you as a crime gun.)
If the Local P.D. still-still refuses to take the report, you can complain directly to your District Attorney's Office. They may either order the P.D. to enter the information, or they may just assign a Sheriff's Deputy or D.A.'s Investigator to do it.
That does two things. First it puts her in jeopardy of getting caught with a stolen firearm: which is a felony in many states. Secondly if she gives it to anyone else and the police ever come across it, they will run the serial number in the database, it will come back to being your firearm, and it should be returned to you, even if it is used in a crime, after it is no longer needed for court.
Nothing is a sure thing, but it does give you a degree of protection, and I would expect that just the threat of being suspected by the authorities of possessing a stolen firearm would make most ex-girlfriends feel that it is not worth it.
In fact, you had witnesses that you had given the gun to her, and if it was entered into the NCIC database, and if you could articulate that it is reasonably believed that she still has the firearm in a certain residence/building, that can be enough for grounds for a search warrant for that location. No woman wants to have her personal belongings rummaged through, and then possible arrest, just to inconvenience an ex-boyfriend.