Mr Johnson sent the message to "everybody involved" in the summit at Carbis Bay and "all the other people of Cornwall".
French President Emanuel Macron thanked people for their "patience" amid the "difficulties that we create".
Police had put up roadblocks around Carbis Bay during the summit.
Mr Johnson thanked "all the people, not just of Carbis Bay, but everybody involved, all the other people of Cornwall for their hospitality".
And he said: "All the other delegations would also want to express their thanks as well."
Mr Macron thanked "Great Britain and the population of Cornwall for their hospitality".
For some the G7 summit, with 6,500 police in attendance, was a welcome distraction.
Daniel Oates, 34, from St Ives, said the event had been "an exciting buzz and fantastic" for the town.
Duncan and Andrea Kinloch arrived on holiday from Lancashire on Saturday and spent the morning on the beach.
"It was quite nice looking at the big boats out there, and all the police have been really friendly," they said.
"Getting here was easy - we had expected a lot more disruption.
"It's been a bit of excitement."
Ruthie and Tony Goff, whose Carbis Bay home overlooks the beach embraced all the attention, with Mrs Goff describing it as "amazing" for the local area.
But some businesses in Falmouth, where the International Media Centre was based, and St Ives said despite the influx of people they had seen a loss in trade.
Others hoped it would put the area "on the map going forward".
Some people have spent time motorcade-watching as the flashing blue lights and long lines of vehicles became a regular feature.
After partners of the leaders visited the Minack Theatre on Saturday, local Miranda Penhaligon said: "We are very isolated here and to see all these cars is just ridiculously amazing.
"We are just so excited, it's like a party."
Later US First Lady Jill Biden tweeted her thanks to those involved.