Mr Johnson then interjected, saying that the female students Mr Razak was referring to “have got to find men to marry”.
Kate Green MP, Labour’s Shadow Equality Minister, called on Mr Johnson to apologise for his “outdated opinions”.
“Boris Johnson may think his buffoonery allows him to get away with his outdated opinions but this isn’t funny,” she said.
“These comments are insulting to the women across the country and across the world who have gone to university, worked hard and used their talents to get on. He should apologise.”
The Everyday Sexism campaign group tweeted that the remarks were “pathetically archaic, unacceptably sexist and hopelessly out of touch”.
A City Hall source said that Mr Johnson’s comments were “off the cuff” and said they were “clearly intended as a joke”.
“He does not, of course, think that at all,” the source said. “It was completely light-hearted. It has been misconstrued.”
Another official present at the event said there was laughter and groans from the audience following Mr Johnson’s comment, but insisted that it was seen as a joke by the audience.
Mr Johnson met his first wife, Allegra Mostyn-Owen, while studying classics at Oxford.
Mr Johnson last month described David Cameron as a “girly swot” because he got a first class degree in Philosophy, Politics and Economics at Oxford.
The Mayor of London got a 2:1 degree from Balliol College.