According to Micheal Arndt it was something BB-8 said to R2 that woke him up.
“…but the idea was that in that scene where R2 plugged in, he downloaded the archives of the Empire, which was referenced by Kylo Ren,” Abrams said. Thirty-eight years later, in both our own and galactic time, that data becomes useful in The Force Awakens when a new droid approaches the dormant R2.
“BB-8 comes up and says something to him, which is basically, ‘I’ve got this piece of a map, do you happen to have the rest?’” Abrams said. “The idea was, R2 who has been all over the galaxy, is still in his coma, but he hears this. And it triggers something that would ultimately wake him up.”
Darn. I was hoping it was Luke using the Force and telling R2 it was time to wake up. Really would like to have seen Luke decide on his own when to return. I just hate the idea of these people looking for him on a map. Which sounds more interesting, chasing a McGuffin in order to locate the Ark of Covenant, or fighting a battle and trying to hold out long enough in hopes that the savior might make his appearance?