Rey has evidently heard myths and legends about the Jedi from childhood. The factbook Rey's Survival Guide mentions that on several occasions she's traveled to the "Sacred Villages" near to Nima Outpost and that
One village believes in the Force and the legends of the old Jedi
sorcerers
In the absence of any actual Jedi, I think we can assume that she thought that these are simply stories but that doesn't mean that she didn't take in the information. Given her own abilities, it may also have been that she found some personal resonance with these myths.
Within the film's official novelisation, there's a pretty solid explanation of what young children are taught about the Jedi (in the preface) and specifically about Luke:
Legends told that they possessed abilities beyond the ordinary,
including powers of the mind, of invisible strength, of foresight and
wisdom. But as wise as they were, the Jedi were not wise enough to see
the evil within their beloved Republic. Those whom the Jedi had
trusted as friends and allies betrayed and murdered them.
and
Though the losses piled up and victory seemed impossible, these rebels did not surrender. They found hope in the heroics of a young
man named Luke Skywalker. By learning the way of the Jedi, he helped
bring an end to the tyranny.
Within the main novel, we get some insight into what the understanding of the average person is:
“Apparently he’s carrying a map that leads to Luke Skywalker, and everyone’s insane to get their hands on it.”
“I thought Luke Skywalker was just a myth.”
and
“There have been all kinds of rumors and stories,” Han said. “The
people who knew him the best think he went looking for the first Jedi
Temple.” Rey looked stunned. “The Jedi were real?”
“I used to wonder that myself. A bunch of mumbo jumbo, I thought. Some
magical power holding together good and evil, light and dark.” Han
shook his head and smiled. “Crazy thing is, it’s all real. The Jedi,
the Force, it’s…true. It’s all true.”
Finn’s brain hurt. His conception of the universe was falling apart.
Did the Jedi and the Force actually exist? Had the First Order lied
about them, too? Finn doubted a smuggler as seasoned as Han Solo would
believe in such myths unless he had seen hard proof that they were
real.
You may also want to note that according to the novelisations for the prequel trilogy, the Jedi weren't simply a mythical society but a well-integrated part of the Galactic Republic. Obi-Wan and Anakin were apparently household names on Coruscant and throughout the Republic.