Mr Trump's views, aired in an interview with The Sun newspaper, come as he is due to meet the current occupant of Number 10 Theresa May at her Chequers residence on Friday.
The president has previously spoken of his admiration for the former foreign secretary and mayor of London.
Before flying to the Nato summit in Brussels, he told reporters: "He has been very, very nice to me, very supportive. Maybe we'll speak to him when I get over there.
"I like Boris Johnson. I've always liked him."
Mr Trump went further in his Sun interview, saying: "I was very saddened to see he was leaving government and I hope he goes back in at some point.
"I think he is a great representative for your country.
"I am just saying I think he would be a great Prime Minister. I think he's got what it takes."
The pair have not always seen eye-to-eye, however.
In 2015, Mr Trump claimed parts of London were so radicalised that "police are afraid for their own lives".
Mr Johnson said the claim was "simply ridiculous", adding: "I would welcome the opportunity to show Mr Trump first hand some of the excellent work our police officers do every day in local neighbourhoods throughout our city.
"Crime has been falling steadily in both London and New York and the only reason I wouldn't go to some parts of New York is the real risk of meeting Donald Trump."