The teenager has become a first-team regular since Brendan Rodgers took over in the summer and earned a first England cap against Sweden in November.
"It's every 18-year-old's dream," Sterling, who joined Anfield's academy from QPR in February 2010, told Liverpool's official website. "I'm just really grateful to be at such a big club like this.
"There's a lot more to be done. I haven't begun yet, as the manager has said. Hopefully I can kick on after the New Year and try to do my best for the team and the football club."
Managing director Ian Ayre said: "This is another positive step forward for the football club in securing the long-term future of one of the country's brightest young talents.
"Since the summer, Luis Suarez, Daniel Agger, Martin Skrtel, Jonjo Shelvey and Suso have all signed new long-term contracts and it's a clear indication of our intent to keep the players we believe are crucial to bringing success on the pitch.
"It also shows the belief the players have in the vision and leadership of Brendan Rodgers and everyone at this football club."
Don't miss any live and exclusive football coverage this festive season. Click here to visit Sky Sports' Festive Calendar