American Johnson won on the final hole against the 22-year-old Spaniard at Austin Country Club in Texas on Sunday.
It was a third successive tournament win for the 32-year-old who had earlier beaten Japan's Hideto Tanihara by one hole in a hard-fought semi-final.
Johnson was five up after eight holes and had to survive a Rahm fightback.
"It was a lot longer match than I would have liked it to have been but Jon was a great competitor and it was a great match," said Johnson.
"It's impossible to win every week. I know that. I've won my last three but I'm just going to have to keep working hard, keep working on the things that I'm working on right now.
"Being the number one player in the world kind of drives me to work harder and to get better. There's still a lot of room for improvement in my game. So I'm just going to keep working on it."
Rahm missed good birdie chances on the first two holes and fell behind with a bogey on the third, but clawed a shot back on the ninth before Johnson birdied the 12th.
However, three birdies from the Spaniard in the space of four holes saw Johnson taken to the 18th for only the second time this week.
Johnson and Tiger Woods are the only players with four or more WGC titles and although Woods won an incredible 18, the former world number one failed to collect the HSBC Champions trophy in his only two appearances.
The US Open champion also became the third player after Rory McIlroy in 2015, and Woods who did so on three occasions, to win this event as top seed.
"It's amazing how he (Johnson) is able to keep cool the entire round. It amazes me. And he's just a perfect, complete player," said Rahm.
Exciting prospect Rahm beat Bill Haas 3&2 in their semi-final and was attempting to become the youngest winner of a WGC event.
The Spaniard, who was the world's top-ranked amateur while studying at Arizona State University, began the week ranked 25th in the world after winning his first PGA Tour title in the Farmers Insurance Open at Torrey Pines in January.
American Haas, 34, beat 38-year-old Tanihara 2&1 to finish third.
Full results (external site)
World number one Dustin Johnson beat Jon Rahm in the World Match Play final to become the first player to win all four World Golf Championships.