A final exit poll on Monday showed Mr Duda, an ally of the conservative government, with 51% of the vote.
He was pitted against the socially liberal Warsaw mayor Rafal Trzaskowski.
The vote has been widely seen as a battle for the country's future as well as its strained relations with the European Union.
Mr Trzaskowski received 49.6% of the vote, according to the first exit poll, which pollster Ipsos said had a margin of error of two percentage points.
But two further polls have shown a wider margin between the pair.
A second poll - combining exit poll data with partial official results - suggested Mr Duda received 50.8% of the vote, while a third showed 51% percent, with a margin of error of one percentage point.