Technically, Luke did not take years to learn the ways of the Force either. As the prequel movies showed, a formal Jedi training normally took years, with the apprentice typically entering during early childhood, and finishing after reaching adulthood. However, in Episode IV, A New Hope, Luke is introduced to the Force by Obi-Wan who also gives him a lightsaber. Literally several hours later, Luke already succeeds in deflecting lasers while blindfolded, and he uses the Force to guide his torpedo to its target. When Luke duels with Darth Vader in Episode V, The Empire Strikes Back, he manages himself quite well, even though he only had a reltively short time training with Yoda. A lot of what Luke does seems pretty much self-taught, so apparently, some Jedi apprentices are strong in the Force and adept that they can master the basics much faster than others. It may take additional training by a Jedi Master to reach their full potential, though.
While Rey's parentage remains a mystery, it is evident that she's also incredibly powerful in the Force. However, she was able to perform the Jedi mind trick, telekinetically draw an object toward herself, and defeat a powerful Dark Side user, all without any training and barely any knowledge of the Force. It has been suggested that when Kylo Ren reached into Rey's mind to extract the image of the map, he unwittingly allowed her to reach into his mind as well. Therefore, the experience may have given her some knowledge of the Force. It's also possible that Rey already learned these powers, but they were suppressed for a mysterious reason. However, the Force was awakened in her when she took ahold of Luke's lightsaber in Maz Kanata's temple, hence the title of the film. Also, while the Jedi and the Sith were considered extinct, and Rey believed Luke Skywalker to be a myth, the Force was common knowledge, as "may the Force be with you" was a common saying. Therefore, it's likely people knew about the abilities to mind-trick and control objects from a distance. So Rey, hearing the stories, decided to make an attempt at it and succeeded.
It was also established by Obi-Wan in A New Hope, that the Force will partially control your actions, but will also obey your commands. Throughout the series, it is suggested that the Force is a conscious entity that is always looking for balance. It is therefore not unthinkable that the Force favors certain key players in helping them guide their actions. Rey, remembering what Maz Kanata said, closed her eyes and let it guide her.