Most Conservative MPs voted against delaying Brexit – including seven cabinet members – meaning Mrs May had to rely on Labour and other opposition votes to get it through.
Theresa May has long insisted that the UK will leave the EU on 29 March with or without a withdrawal deal.
But she was forced to offer MPs a vote on delaying Brexit after they rejected her withdrawal agreement by a large margin, for a second time, and then voted to reject a no-deal Brexit.
She has warned that extending the departure date beyond three months could harm trust in democracy – and mean that the UK would have to take part in May’s European Parliament elections.
Downing Street said the government was still preparing for a no-deal Brexit.
Theresa May is planning to hold another “meaningful vote” on her withdrawal deal on Wednesday – after it was overwhelmingly rejected on two previous occasions.
She then plans go to an EU summit the following day, where she would ask for a one-off extension to get the necessary legislation through Parliament.
A spokesman for the European Commission said extending Article 50, the mechanism taking the UK out of the EU on 29 March, would need the “unanimous agreement” of all EU member states.
And it would be for the leaders of those states “to consider such a request, giving priority to the need to ensure the functioning of the EU institutions and taking into account the reasons for and duration of a possible extension”.