Mr Trump has endorsed the Prime Minister in the past and said Jeremy Corbyn would be “bad” for Britain.
Asked whether he welcomes Mr Trump’s support, during an interview with LBC on Friday, Mr Johnson said the UK and US “traditionally” stay out of each other’s political campaigns.
He also reminded listeners of Barack Obama’s endorsement of remain ahead of the EU referendum in 2016, for which he was criticised.
The president is due in London on Monday and Tuesday next week for a Nato summit.
Mr Johnson said: “We have very close friendships and relationships with the United States at every level of government, but what we don’t do traditionally as loving allies and friends is get involved in each other’s election campaigns.
“I may just remind you that one of the cardinal moments of the referendum campaign in 2016 was when Barack Obama turned up and weighed in heavily on the side of Remain in a way that was not entirely conducive to the good of that cause.
“When you have close friends and allies like the US and UK, the best thing is for neither side to get involved in each other’s election campaigns.”
Mr Trump has also endorsed the idea of an electoral pact between the Prime Minister and Brexit Party leader Nigel Farage ahead of the December 12 poll.
It comes as Labour Party leader Jeremy Corbyn claims documents obtained by his party confirm the NHS would be on the table in post-Brexit trade talks with the US under a Tory government.
Mr Corbyn provided a 451-page dossier as “proof” the Conservatives were putting the NHS “up for sale”, as the US want “total market access”.
But Mr Johnson dismissed the claims as “nonsense” saying the NHS would not be part of trade talks.