Jennings scored a brilliant 146 not out to allow England to declare late in the day on 322-6.
Sri Lanka closed on 15-0 and must bat the final two days for a draw or score a record 462 to win to deny England a first away win in 13 Tests.
Jennings's century was his first since his ton on debut in 2016.
He batted patiently early on as England lost wickets in the morning session, before attacking after reaching three figures for the first time in 22 innings.
The tourists had lost Rory Burns and Moeen Ali in poor fashion before lunch, with captain Joe Root also falling, but Jennings put on 107 with Ben Stokes, 77 with Jos Buttler and 61 with Ben Foakes.
The late contributions ensured Sri Lanka must make the highest successful run chase in Test history, at a ground where the highest winning chase is just 99.
When the hosts began their mammoth chase England tried five different bowlers in seven overs before the close, but Sri Lanka's openers safely kept all 10 wickets intact.
It is currently the rainy season in Sri Lanka but so far any forecast rain has stayed away, and if it continues to do so then England look likely to earn their first Test win overseas since 2016.
A win would also be their first in Tests at Galle and would put them 1-0 up in the three-match series.