The deal begins with the 2022-23 season and runs through the 2023-24 season.
Carter, 37, is third on the team this season with 12 goals and sixth with 26 points in 36 games. He is in his second season with the Penguins, who acquired him from the Los Angeles Kings in a trade last April.
"Jeff's experience and versatility have made him a valuable addition to our team," Pittsburgh general manager Ron Hextall said in a statement. "In addition to his on-ice contributions, his team-first attitude has made him a leader inside our locker room and we are happy to have him under contract for two more years."
Carter has 21 goals in 50 games since joining the Penguins -- only Jake Guentzel (24) has more goals for Pittsburgh during that time span.
A two-time Stanley Cup champion (2012 and 2014 with the Kings) and two-time All-Star, Carter has 411 goals and 377 assists in 17 NHL seasons. He is one of seven active players with 400 goals.