The Vatican said about 1.5 million people attended his closing Mass at a riverside park in the Portuguese capital.
Many of those attending slept outdoors, having attended a vigil there on Saturday night, gathering in sweltering heat.
Speaking after the Mass, the Pope, 86, urged the young people to take the fraternal experiences of the six-day jamboree home and apply them to their daily lives.
"Dear friends, allow me, this old man, to share with you young people a dream that I carry within me," he said.
"It is the dream of peace, the dream of young people praying for peace, living in peace and building a peaceful future.
"As you return home, please continue to pray for peace.
"What is more, you are a sign of peace for the world, showing how different nationalities, languages and histories can unite instead of divide. You are the hope of a different world."
Pope Francis asked them to think of the young people who could not come to the event because of the world's many armed conflicts and wars.
"In thinking of this continent, I feel great sorrow for beloved Ukraine, which continues to suffer greatly," he said.
The Pope, who returned to Rome on Sunday evening after an event to thank and pray with 25,000 volunteers at the World Youth Day festival, met a delegation of 15 young people from Ukraine during his trip.
Europe urged to act as 'peacemaker' in Ukraine by Pope Francis - video
In his speech, the pontiff referred to the Portuguese seaside town of Nazare, which has some of the biggest waves in the world, and described the people there as "surfers of love".
The TAP airline plane carrying the Pope, his entourage and reporters took off from Lisbon's Figo Maduro military air base shortly after 6.20pm.
Bishops and Portuguese leaders lined up to say farewell to Pope Francis before he boarded the plane.
Sunday's Mass was concelebrated by 700 bishops and 10,000 priests, who distributed communion to the huge crowd.
Marina Sylvester, 22, from the Pope's native Argentina, was one of hundreds of thousands of young people who spent the night in the riverside area.
Ms Sylvester woke at dawn and by 7am was showing off her dance moves as a well-known Portuguese priest DJ, Guilherme Peixoto, played upbeat songs.
"It has been one of the best experiences of my life," she said.
The Pope said the next World Youth Day would be held in Seoul, South Korea, in 2027.
One of the recurring themes of his visit was social media and its potentially negative effects on young people.
During the week, Pope Francis urged them to beware of the false happiness of the online world and at another event, the young people reflected on their anxieties, their yearning to save the planet and the "tyranny" of social media.
The trip took place in the shadow of a report six months ago by a Portuguese commission that found at least 4,815 minors were sexually abused by clergy – mostly priests – over seven decades in the country.
It was one of a series of reports around the world that have exposed clerical sex abuse and rattled the Catholic Church in recent years.
Pope Francis said on Wednesday that the Church needed a "humble and ongoing purification" to deal with the "anguished cries" of victims of clerical sexual abuse, and met privately with 13 victims.