There are not very many clues in the movie for how long things take, but we know that it took at least a few days. I would estimate, best guess, probably just under a week. (Though, note that keeping track of time in the presence of hyperspace and FTL travel gets messy.)
Poe gets captured on Jakku and sends BB-8 off into the desert. Meanwhile, Rey scavenges for parts and trades them in for dinner. Rey and BB-8 meet up, and Rey says that BB-8 can stay with her for the night. At this point, in Rey's local time zone, it is nearing sunset.
Finn gets reprimanded by Phasma (I think she even specifically says this happened "yesterday" during the Day 2 events but I could be wrong.)
NOTE: It's possible that these events actually span more than one day; we don't know how long BB-8 took to cross the desert, but my feeling is that, when you factor in Finn's part in the plot, it probably happened within the same day.
Rey takes BB-8 into to town. It's now mid-morning, at least, so it's definitely a new day. Meanwhile, Finn rescues Poe and crashes on Jakku. Rey/Finn meet and they flee the First Order
in the Millenium Falcon.
As soon as the pair escape Jakku's atmosphere, the ship breaks down and they stop to enact repairs. After they finish, but before they can move, they're
captured by Han Solo.
This all happens without any gaps in between, so it must be the same day.
Also, note that we later find out that
Poe woke up on Jakku later that night.
The crew heads to Maz's cantina to book passage for BB-8. Here's where things get fuzzy, because we don't know how long it took to get to the cantina, nor how long they stayed there.
However, note that enough time passed for
Poe to wake up the night of Day 2, get rescued, and make it back to the Resistance base before Han et al. get into the cantina,
because he leads the rescue party that was presumably sent as soon as BB-8 was recognized.
The resistance has a meeting where they plan to try and take out the Starkiller. They have time to repair the ships, rest up, restock, etc. before setting off. I'm guessing the entire final act, from this point on, takes place in the course of a single afternoon, because there's a timer on the weapon firing and it starts charging while everyone's still on the resistance base.
After the battle, I'm guessing we take a little downtime for everyone to rest up again, and Finn
to get a bit of medical care
sets off to find Luke.
That trip probably also takes a while, so I'm estimating that the final scene probably takes place, from e.g. Rey's perspective, about 6 days after the opening ones.