The 22-year-old Florida-based Puig defied her ranking of 34 to get the better of the world number two and Australian Open champion on the back of a sizzling 54 winners.
Puig, who also knocked out French Open champion Garbine Muguruza in the quarter-finals, is the first woman from the Caribbean island to win a medal of any sort.
Before her golden breakthrough, Puerto Rico had won just eight Olympic medals, two silver and six bronze. Six of that total had come in boxing.
Victory for Puig came in a dramatic seventh game of the final set when she saved six break points before taking gold on a fourth match point when a Kerber forehand sailed wide.
"Oh my God," she screamed before breaking down in floods of tears and parading her national flag around centre court.
Kerber had cruised into the final without dropping a set as the second seed aimed to emulate Steffi Graf who was Germany's last champion at the 1988.
However, her perfect record in Rio ended when Puig grabbed the first set against a suddenly lacklustre looking German who required treatment on a back injury between sets.
Her medical timeout worked wonders as she broke in the first game of the second set.
Puig retrieved the damage in the eighth game but she faltered when she had the chance to serve for a 5-4 lead.
Kerber, 28, levelled the final in the 10th game but needed four set points to get the job done.
That set the foundation for the thrilling decider where Puig raced into a 5-0 lead before having to suffer for her place in history during a marathon seventh game.
"She deserved to win," said Kerber, a Wimbledon finalist last month.
"It's not the medal I wanted but it's still a silver. She was hitting everything, she played a great match.
"It's still a special feeling. I am having the best year of my career."
On Friday, after beating two-time Wimbledon champion Petra Kvitova in the semi-finals, Puig had vowed to win gold and bring some light relief to Puerto Rico.
The US territory is buried under some $70 billion in debt.
There is also a growing concern over the Zika virus, which has spread quickly through the island.
In July, US health officials reported that as many as 50 pregnant women per day have been infected, raising the risk of birth defects.
Before London in 2012, all of the island's Olympic medals had come in boxing.
Four years ago, Jaime Espinal won a wrestling silver while 400m hurdler Javier Culson took home a bronze.
Meanwhile, Kvitova won the bronze medal play-off by defeating American seventh seed Madison Keys 7-5, 2-6, 6-2.
In an untidy clash, the two women hit a combined 87 unforced errors while Keys's challenge was undone by only converting two of her 10 break points.
Argentina's Juan Martin del Potro ended Rafael Nadal's hopes of a second Olympic singles title Saturday with an epic 5-7, 6-4, 7-6, (7/5) win to set up a gold medal showdown with defending champion Andy Murray.
The world number 141 Del Potro, whose career was almost ended by a series of wrist operations, triumphed after three hours and eight minutes of compelling centre court action.
Second seed Murray reached his second successive Olympic final with a ruthless 6-1, 6-4 demolition of Japan's Kei Nishikori.
Nadal, the 2008 singles champion, had won the men's doubles on Friday with Marc Lopez but playing his 10th match of the Rio tournament finally caught up with him.
Murray can become the first player to defend an Olympic singles gold but he must get past a rejuvenated 2009 US Open champion Del Potro, who shocked world number one Novak Djokovic in the first round.
"It means a lot to me. It's very big, maybe even more special than when I won the US Open," said 27-year-old del Potro who was mobbed by Argentine fans at the end of the semi-final.
"I didn't expect to get to the final; I didn't expect to beat Djokovic. It's just amazing for me."
- Match of emotion -
====================
In a rollercoaster of a semi-final, Nadal saved eight break points in the final set before del Potro raced through the tiebreaker.
Nadal saved a match point but his fate was sealed when he ballooned a forehand wide of the court.
"I tried my best. It was a great match, full of emotion and played to a high level," said Nadal who was playing his first tournament since May when a wrist injury forced an early withdrawal from the French Open.
"I am satisfied. I did my best. I fought and with great spirit. After two and a half months without playing, I was able to compete against some of the best players in the world."
Del Potro went into the semi-final trailing Nadal 8-4 in career meetings. He had not beaten the Spaniard on a hard court for five years.
But he struck first with a break of Nadal's opening service game.
Nadal, who missed his Olympic title defence through injury in 2012, levelled at 4-4 before carving out the key break in the 12th game to grab the set.
Del Potro, a bronze medallist in 2012, refused to yield and claimed the only break of the second set with a trademark monster down-the-line forehand in the third game.
The 1.98m (6ft 6ins) Argentine survived a break point in a 10-minute second game of the decider which set the tone for the dramatic conclusion.
Meanwhile, Murray insisted he's ready to conquer the challenge of becoming the first player to win back-to-back Olympic golds.
"It would mean a lot to me. It's not easy, that's why it's never been done before, but I will go out there and give it my best," said the 29-year-old world number two.
"I am guaranteed a medal already but the goal is to win gold and I'll do all I can to do it."
Saturday's victory allowed Murray to extend his mastery over Nishikori to 7-1 and stretch his current winning streak to a career-best 17 matches.
Nishikori, 26, had to save three match points to beat Gael Monfils in the quarter-finals and the effort took its toll on Saturday when he was broken in the fourth and sixth games of the first set.
The Japanese star won just five points off the Murray serve in the opener and seven in the second when he was broken again in the sixth game.
He managed to save two match points but dumped the third into the net with a weary backhand and the contest was over in 80 minutes.
Murray didn't face a single break point in the match.
Nishikori and Nadal will meet for the bronze medal on Sunday.