If MPs reject the Prime Minister's Withdrawal Agreement for a third time, the UK will have until April 12 to set out its next steps, with a longer extension on offer only if Britain takes part in European Parliament elections in May.
Leaders of the remaining 27 EU member states drew up the deal in a mammoth eight-hour meeting in Brussels, after turning down the PM's plea to postpone Brexit from March 29 to June 30.
Mrs May spoke with European Council president Donald Tusk during and after the meeting, but aides declined to say whether she was able to feed into the discussions taking place in her absence.
In a midnight press conference in Brussels, the Prime Minister said the "flextension" plan offered MPs a clear choice.
"We can leave with a deal in an orderly manner, have that extension until May 22, or if we don't get that deal, that vote, through then we have to come forward with another plan, and if that plan means another extension, it means standing in those European elections," she said.
"Tomorrow morning I will be returning to the UK and working hard to build support for getting the deal through."
And she left no doubt that she does not believe the UK should have to elect MEPs in the polls scheduled for May 23-26 across Europe.
"It would be wrong to ask people in the UK to participate in these elections three years after voting to leave the EU," she said.
Aides later confirmed that Thursday's agreement means that no-deal Brexit was no longer a possibility on March 29, but stressed that it remained on the table if MPs have not approved the Withdrawal Agreement by April 12.
The format increases pressure on Leave-backing MPs to row in behind Mrs May's deal, for fear that if it falls the UK could find itself electing new MEPs and remaining for month or years within the EU.
But it also creates a fortnight's breathing space if Mrs May reaches the end of next week without securing agreement for her package, or if Speaker John Bercow prevents her from tabling a motion which he regards as a repeat of those already defeated by 230 votes in January and 149 votes last week.
Parliament could use that time to try to take control of the process and force Mrs May towards a softer Brexit stance or second referendum.
Tory former minister Sir Oliver Letwin has tabled a Commons amendment seeking to allow MPs to take control of the order paper in a bid to try to find a way forward on EU withdrawal next week.
The amendment to Monday's Government Brexit motion calls for MPs to use parliamentary time on Wednesday March 27 to consider and vote on EU exit options.
The amendment is backed by a cross-party group of MPs including Labour's Hilary Benn and Tory former attorney general Dominic Grieve.
Downing Street was unable to say which day the Government would seek to bring back the Withdrawal Agreement for a third "meaningful vote" - known in Westminster as MV3.
But sources confirmed that Mrs May will table secondary legislation to remove the date March 29 from Brexit laws.
Some in Westminster predicted that the deal meant that Mrs May's days as Prime Minister were numbered.
Leave-backing Stewart Jackson, who was David Davis's chief of staff when he was Brexitsecretary, said she should "stand down immediately" if she loses next week's vote.
"Conservative members will no longer tolerate her grovelling to the EU and national humiliation," said the former Conservative MP for Peterborough. "I suspect the Whips, 1922 (Committee) and Cabinet will help the process."
And a former policy adviser to the PM, George Freeman, said that if MV3 failed, Parliament would "take control, switch to Plan B and get agreement to join Efta (the European Free Trade Association) by April 12, with or without this PM."
Setting out the terms of the Brexit extension, Mr Tusk said: "April 12 is a key date in terms of the UK wondering whether to hold European Parliament elections.
"If it is not decided do so by then, the option of a long extension will immediately become impossible."
And he added: "What this means in practice is that until that date all options remain open."
Asked how long the "long extension" eventually on offer to the UK could be, European Commission president Jean-Claude Juncker replied: "Until the very end."
Chief Brexit negotiator Michel Barnier told reporters: "It is not a deal, it is a step in the process. We are constructive and patient."
In a 90-minute presentation to her European counterparts at the start of Thursday's summit, Mrs May was reportedly pressed on what she will do if MPs reject her deal for a third time, but she did not commit herself to a Plan B or rule out a no-deal Brexit.
She was later excluded from the meeting as the EU27 thrashed out the future of Brexitin her absence.
And she had to eat alone as they continued their discussions over dinner, with her serving of lentil terrine with langoustine followed by roast duckling sent up to her in the UK delegation room by kitchen staff.
French president Emmanuel Macron said the Brexit delay avoided a "crisis situation" next week and allowed the EU to "continue working properly."
Mr Macron said the onus is now on Britain to take its responsibilities after the European Council "lifted uncertainties with clear rules".