Richard, 34, is the oldest player on the team, which doesn't envision being competitive until 2019 or 2020.
Richard is 7-14 with a 4.82 ERA and has thrown 185 innings.
General manager A.J. Preller said Wednesday that Richard wanted to remain with the Padres and that his veteran presence in a clubhouse full of young players is valuable.
Preller said Richard will be in the rotation to start the 2018 season, but that he understands it will be competitive from there on and that he could be used in other roles.
"We bet on people, and he's a pretty easy person to bet on in terms of work ethic and the way he goes about it," he said.
Richard said he believes in the direction the Padres are going.
"What I'm going to do the next couple of years is what I've been doing: continue to work hard and help get this team in position to win baseball games," he said. "Hopefully that will be a good example for the young guys."