Hill is in his second spell as Dale boss, having returned after an 18-month spell at Barnsley in January 2013, and has taken charge of 466 games.
His side just missed out on the League One play-offs this season, finishing ninth, four points off the top six.
"We've been very successful as a partnership," Hill said.
"I didn't see any reason why that partnership shouldn't continue."
Chairman Chris Dunphy added: "Keith has brought nothing but success to the club and we've continued to go from strength to strength during his time here."
Meanwhile, full-back Joe Rafferty has signed a two-year deal, on the back of a supporters' player of the year award for 2016-17.
Rafferty, 23, joined Dale from Liverpool in 2012 and has played 179 games since, scoring three goals.
He was a regular under Hill in 2016-17, making 50 appearances in all competitions.
"I wanted to stay because I'm happy here, and I want to achieve more with this club," Rafferty told the club website.
"We've achieved something different every year that I've been here and I want to keep on achieving."
Manager Keith Hill has signed a new five-year contract with League One side Rochdale, which will expire in the summer of 2022.