Both sentences are grammatically correct. As to the verb tense ...
In English, we usually tell stories in past tense. The only thing in present tense is usually things that are true forever, like laws of physics.
So if you were telling a story, and in the course of that story you wanted to say that her parents found out about the boyfriend, you would generally say, "Her parents found out that she had a boyfriend." You are describing what happened at some time in the past. At that time in the past she had a boyfriend. She may or may not still have a boyfriend. The story hasn't gotten that far yet. Maybe it never will. Maybe when you get to the end of your story, the last events you know about, she still has a boyfriend, but it's possible that since then she no longer has a boyfriend.
Indeed, this convention can be essential to making a narrative work. If you always put things that are still true in present tense but things that are no longer true in past tense, you could be giving away the end of the story and thus ruining all suspense.
We do conventionally use present tense when talking about something that is true forever, or at least, that has been true for millennia and will likely be true for millennia into the future. Like, "Her parents found out that the Earth orbits the Sun."
It is also possible to tell a story with mixed tenses. This is more common in conversation than in a novel. Like if you were telling a friend about someone you both know, you might say, "Yesterday her parents found out that she has a boyfriend." They found out in the past, but the boyfriend is still there in the present.
Also in general, using the past tense does not necessarily mean that something is not true any more. It might still be true or it might not. Sometimes the context will make clear that it is no longer true. Like if I said, "I dated Sally before she got married", most readers would understand that to mean that since she got married i don't date her any more, both for grammatical and logical reasons. Sometimes people play games with careful wording, leading you to assume something that isn't true. Comedians will do this for a joke, and politicians will do this to obscure their meaning while giving them an out if they are challenged, so they can say, "Well, yes, when I said that I did this 20 years ago, I didn't mean that I'm not still doing it now ..."