The Prime Minister said the inquiry, which is expected to cost several million pounds, was needed to ensure “this terrible tragedy is properly investigated”.
Her decision comes as residents demand answers as to why fire swept through the 24-storey block in north Kensington so quickly – and why their warnings were apparently ignored.
The Government has come under criticism for not publishing a review into a fire in a tower block in Camberwell in 2009, the findings of which could have impacted on tower block safety.
The London mayor Sadiq Khan had called for an inquiry and Labour leader Jeremy Corbyn said some “very hard questions have got to be asked and some very hard questions must be answered”.
Mrs May visited the scene on Thursday morning, chatting to firefighters and emergency responders as she was shown the charred shell of the building where at least 17 people died.
Mrs May said: “We need to know what happened, we need to know an explanation.
“We owe that to the families, to the people who have lost loved ones and the homes in which they lived.
“That is why I am ordering a full public inquiry so that we can get to the answers, we can find out exactly what happened.”
After his own visit to the site, Mr Corbyn said: “Hundreds of thousands of people in our country live in tower blocks, very high-rise tower blocks. Every single person who lives in a high-rise apartment today is going to be thinking, ‘How safe am I?'”
It is not yet known what scope the inquiry will be, but Mrs May said it will be in addition to the immediate fire report and any potential police investigation.
Mrs May came under further attack for not immediately visiting residents of Ladbroke Grove and Notting Hill affected by the fire.
In contrast, Mr Corbyn was shown on TV visiting staff and volunteers of the relief centres at the scene.
Rachel Swindon tweeted: “Today, Theresa May visited #GrenfellTower and she refused to meet any residents. This cowardly embarrassment needs to go, and go now.”
Political commentator Owen Jones said on Twitter: “Appalling that Theresa May went to Grenfell Tower and didn’t meet the residents. It’s just appalling.”
The Government says that trade minister Greg Hands had chaired a meeting with residents and various Government figures were liaising with residents and groups on the ground.
It added that the response committee chaired by fire minister Nick Hurd would meet again on Thursday afternoon
Police and fire minister Nick Hurd is currently taking questions from MPs in Westminster Hall.