The prime minister was visiting the maternity ward at Whipps Cross Hospital when he was approached by a father.
The man, who is also a Labour activist, told Boris Johnson that the ward was understaffed and the NHS was being destroyed.
A spokesman for the prime minister later said Mr Johnson was visiting public services to see for himself the reality of the situation.
They added the prime minister was “not going to hide away from those circumstances when he goes on these visits, and so obviously is keen to talk to people and empathise and see what he can do to help.
“It’s also a reminder of why exactly he is so keen to make the NHS a priority.”
A 15-year-old boy has been stabbed to death in east London.
Police officers were called to Byford Close in Stratford at 18:45 BST on Tuesday following a report of a fight, the Met Police said.
One witness said she saw the teenager “collapse on to the floor” and paramedics “tried their best for an hour” but they were unable to save him.
No arrests have been made but the death is being treated as murder. It is the 93rd homicide in the capital this year.
The witness, who wanted to remain anonymous, said paramedics had “arrived straight away” to treat the boy “but when they couldn’t save him I saw one of them crying”.
A man who said he had lived in the area for 30 years told the Press Association there had been “numerous stabbings” in recent years.
“It used to be a peaceful area but now it’s become a terror to live in,” he said.
A section 60 order, which allows police to stop and search people, was put in place for the whole of Newham borough until 12:30.