The official results are expected to be announced over the next few days.
Duda, who is bidding for a second term in office, won 50.4 percent of the vote, according to exit poll results released seconds after voting ended at 9 pm.
Opposition-backed challenger Rafał Trzaskowski, the mayor of Warsaw, won 49.6 percent, the Ipsos exit poll found.
Turnout on Sunday was 68.9 percent.
In a first round of voting on June 28, no candidate won an outright majority, meaning a second round had to be held.
The Polish president is the head of state and has the power to veto legislation passed by parliament, a key prerogative in a country where traditionalists and liberals are bitterly divided.
(pk/gs)
More to follow