The US president's comments were echoed by his daughter Ivanka Trump, who also congratulated Mr Johnson on social media.
John Bolton, Mr Trump's former national security adviser, also congratulated Mr Johnson and the Conservative Party on "their historic election win".
"Commanding a clear majority, there is now a powerful mandate for Brexit and freeing themselves from the EU," Mr Bolton said in a tweet.
Mr Bolton, who left the White House in September, has been a vocal advocate of the UK's departure from the European Union.
In August Mr Bolton travelled to London to meet Mr Johnson, and told the Prime Minister that the Trump administration was highly supportive of his government.
"We are with you," he said, promising that a post-Brexit trade deal with the US would be swift and saying he agreed with Mr Johnson that a second vote on Brexit would be wrong.
"The fashion in the European Union: When the people vote the wrong way from the way the elites want to go, it's to make the peasants vote again and again until they get it right," he said.
Mr Trump, who has described himself as a "fan of Brexit", has frequently said this year that the US and UK are already working on a "very substantial" post-Brexit trade agreement.
Meanwhile former vice president Joe Biden, the frontrunner in the Democratic race to take on Mr Trump in 2020, drew parallels with the US as he suggested his party should learn from Labour's heavy electoral losses and avoid lurching to the left.
"Boris Johnson is winning in a walk," Mr Biden said during a fundraiser in California, predicting newspaper headlines would read: "Look what happens when the Labour Party moves so, so far to the left. It comes up with ideas that are not able to be contained within a rational basis quickly."
Mr Biden also took aim at the Prime Minister, saying: "You're also going to see people saying, my god, Boris Johnson, who is kind of a physical and emotional clone of the president, is able to win".
Mr Biden's opponent in the Democratic primary, Bernie Sanders, has previously voiced support for Jeremy Corbyn and congratulated the Labour leader on his "effective campaign" in the wake of the 2017 election result, when the party fared better than anticipated.
Mr Sanders has yet to comment on Thursday's result, but a key ally congresswoman Alexandria Ocasio-Cortez seemed to voice support for the Labour Party on election day when she shared Mr Corbyn's campaign video party that accused the Conservative Party's policies of driving austerity.