Ephraim has impressed since Neil Warnock took charge earlier this year and has started all five of the club's games this season.
He spent a spell on loan at Leeds United last term and attracted interest from QPR's Championship rivals Leicester City over the summer. But the 22-year-old, who initially joined the club on loan from West Ham in 2007, is happy to have resolved his future.
"I'm very happy," Ephraim told the club's official website.
"I was in the last year of my contract, so I'm just delighted we've managed to get it sorted after a few months of negotiating.
"I'm really enjoying life under the gaffer and I'm playing some of the best football of my career at the moment, so things couldn't be much better."
Rangers boss Warnock added: "It's his just reward for his performances. We're building for the present day, as well as the future, and he's the type of player we want at this football club."