The 21-year-old, who made his first-team debut for the Owls in August, has scored four goals in 13 Championship appearances this season.
"I'm absolutely thrilled to have committed my future to Sheffield Wednesday," Lavery told the club's official website. "It's a massive, historic football club with a brilliant fan base.
"A big part of my decision to sign a new deal was down to [manager] Stuart Gray for the faith he has shown in me and the environment he has created in recent times.
"I believe I will gain more experience and become a better player by working with Stuart and his coaching staff. I take immense pride every time I wear the shirt and I'm excited to be part of this great club's future."
Lavery is expected to start for Wednesday in this afternoon's match at Doncaster Rovers.