Answering this requires distinguishing between two of the many posts that Johnson holds. Prime Minister, and Leader of the Conservative Party are separate jobs.
The normal process goes like this:
- Johnson gives notice of his intention to resign as leader of the Conservative Party, just as May and Cameron did.
- The Conservative Party then holds a leadership election.
- When that's complete, Johnson resigns as Leader of the Conservative Party and the newly elected leader assumes that job.
- Johnson then resigns as Prime Minister and recommends to the Queen that she appoint the newly elected leader of the Conservatives as PM.
The important point is that Johnson remains PM until he resigns that post. The fact that he's going to be replaced does not allow him to get out of the duties of the PM meantime. And Parliament has decided that getting that extension is a duty of the PM, in new legislation, which is very clear on the point.
If he resigns as PM with no new leader of the Conservatives in place, that gets him out of requesting the extension, but he may well be breaking the rules of the Conservative Party, which will not help them in the election campaign that's clearly going to happen in the next few months. As a resigning PM, he's expected to nominate a successor, who needs to be someone who can demonstrate that they command the confidence of the Commons.
Since Johnson removed the whip from enough Conservative MPs to remove his majority, it's not clear that any of the Conservatives loyal to him could command the confidence of the Commons. He is to some extent "trapped in government", without effective power and with legal obligations he's unwilling to meet. A majority of the Commons has united to put him in this fix, and they don't seem inclined to give him a face-saving way out. This has happened as a reaction to his plan to prorogue Parliament early, which many MPs and quite a few other people see as an attempt to subvert the constitution and the powers of Parliament.
If Johnson resigns without suggesting a successor, we're in unknown territory. One sensible way to handle it would to act as if he'd died unexpectedly, but we don't have much in the way of modern precedents for that. It's also a hypothetical situation.
If the Cabinet put forward one of their number to act as temporary PM, that could work from the constitutional point of view, but they'd have to be willing to seek the extension, and they'd have to pass a vote of confidence once Parliament was in session.
Direct negotiations in the Privy Council could happen. They would be trying to find someone who can get a vote of confidence through for a short-term administration to patch the holes and get the ship stable before an election is held. This almost certainly precludes a no-deal Brexit.
A principle to be followed is that the country is supposed to never be without a government, and forming one that can function is a prerequisite for any further actions.
Overall, Johnson has managed to turn a political crisis, with a strong possibility of an economic crisis should a no-deal Brexit happen, into a likely constitutional crisis. By proroguing Parliament early, he's galvanised his opponents and created the situation he seems to have been trying to avoid.