She will almost certainly remain as interim leader of both the Conservative Party and the Government until the new leader is appointed, as David Cameron did in 2016.
Note that the two roles are technically separate - she is Prime Minister by appointment of the Queen, and because she can command a majority in the Commons, but Party Leader because she won an election according to the Party's own rules. It is the party leadership which she will formally resign on 7th June.
There is no defined "line of succession" for either post, but theoretically the Conservative Party could immediately nominate an interim successor - there was talk of this happening if she was forced out rather than resigning. However, to become Prime Minister as well, that leader would probably need to survive a Vote of Confidence in the Commons, which would be risky because the Conservatives do not have an overall majority.
A much smoother transition can be achieved by her continuing in both roles until a permanent successor is officially announced in July. At that point, she will hand her resignation as Prime Minister to the Queen, and recommend the new leader be appointed as her successor.
I guess it's a bit like "working your notice" when you resign from a full-time job.