The 41-year-old Englishman stumbled with a bogey at the par-3 17th hole but two-putted from 22 feet at 18 to become the first back-to-back winner of the event at Innisbrook Resort's Copperhead course in Palm Harbour, Florida.
Casey had never before defended a professional title and he won for only the second time in six tries with a 54-hole US PGA lead by firing a final round one-over par 72 to finish 72 holes on eight-under 276.
"Today wasn't easy but it felt very different since winning last year," Casey said. "That felt like my first victory. Since then, new confidence. I've felt like a totally different player."
Casey edged Tiger Woods and Patrick Reed by a stroke for last year's Valspar crown.
Oosthuizen, the 2010 British Open champion, and Kokrak, who failed to win his first PGA crown after 198 starts over eight seasons, shared second on 277 with two-time Masters winner Bubba Watson and South Korean Im Sung-jae another stroke adrift.
Casey, who has never broken 70 when leading a US PGA event after 54 holes, won his only prior title when leading entering the last round at the 2009 Houston Open.
This marks the first time in seven years that European players have won three consecutive US PGA events, with Northern Ireland's Rory McIlroy having taken The Players Championship last week and Italy's Francesco Molinari taking the Arnold Palmer Invitational two weeks ago.
Top-ranked Dustin Johnson, one adrift at the start, failed to make a birdie and shot 74 to share sixth with Spain's Jon Rahm and American Ryan Armour on 279.
The poor round snapped Johnson's run of 14 consecutive rounds in the 60s, the longest such streak of his career or by any tour player this season.
Casey opened with a birdie but stumbled early. He found a bunker and took bogey at three, then followed a birdie at the par-5 fifth with bogeys at six after finding deep rough off the tee and seven on three putts from 26 feet.
Oosthuizen began with an eagle, holing at 82-foot bunker shot at the par-5 opening hole. He made bogey at the par-5 fifth but birdied the sixth and dropped his approach to three feet to birdie the par-5 11th and share the lead at eight-under.
Casey blasted out of a bunker to two feet and birdied the par-5 11th to seize a one-shot lead over Oosthuizen and Kokrak, who birdied the par-5 11th and par-3 13th to join the hunt.
Casey couldn't save par from 14 feet after finding a bunker at the par-3 13th, but restored his edge on a birdie at the par-5 14th after dropping his approach two feet from the cup.
Oosthuizen fell back with a bogey at 16 but Casey, after saving par from deep greenside rough at 16, missed a tense five-footer and made bogey at the par-3 17th, falling back into a share of the lead with Kokrak.
Kokrak then missed a nervy eight-foot par putt at 18 and slid back level with Oosthuizen, leaving Casey needing a par at 18 to win.
Casey's final tee shot found a bunker right of the fairway, but he dropped his approach 22 feet from the cup then rolled his birdie try inches past the hole before tapping in for the victory.
Leading scores after Sunday's final round of the PGA Valspar Championship at Palm Harbor, Florida (USA unless noted, par 71):
276 - Paul Casey (ENG) 70-66-68-72
277 - Louis Oosthuizen (RSA) 70-72-66-69, Jason Kokrak 69-71-66-71
278 - Bubba Watson 69-71-70-68, Im Sung-jae (KOR) 70-67-71-70
279 - Jon Rahm (ESP) 71-68-72-68, Ryan Armour 70-72-68-69, Dustin Johnson 69-69-67-74
280 - Denny McCarthy 68-74-69-69, Austin Cook 69-67-72-72, Scott Stallings 69-68-70-73, Luke Donald 67-70-70-73
- Lucas Glover 72-67-72-70, Bill Haas 72-70-69-70, Mackenzie Hughes
(CAN) 70-72-68-71, Matt Jones (AUS) 73-68-68-72, Curtis Luck (AUS)
282 - Kang Sung (KOR) 71-71-72-68, Vaughn Taylor
74-69-71-68, Rory Sabbatini (SVK) 70-69-73-70, Charley Hoffman
69-74-69-70, Brian Stuard 68-72-69-73, Jim Furyk 69-71-68-74
Kevin Kisner 67-75-72-69, Julian Etulain (ARG) 69-73-71-70, Zach
Johnson 71-72-70-70, Henrik Stenson (SWE) 70-73-69-71, Russell Knox
(SCO) 67-76-67-73, Nick Taylor (CAN) 71-70-67-75