He won 55.2% of the popular vote, after entering a run-off with Bailey when neither managed to secure a majority in the first round of voting.
The former MP became the first Muslim mayor of an EU capital city when he was first elected to the role in 2016.
The Green Party's Sian Berry came third, while the Liberal Democrats' Luisa Porritt was fourth.
The Lib Dems lost their deposit, as Ms Porritt failed to win more than 5% of the vote.
Speaking after the results were announced, Mr Khan said: "I will always be a mayor for all Londoners, working to improve the lives of every single person in this city.
"The results of the elections around the UK shows our country, and even our city, remains deeply divided.
"The scars of Brexit have yet to heal. A crude culture war is pushing us further apart.