You can cut Sortmail off in two ways, and both work immediately.
From Sortmail
Inboxes → Disconnect. Sorting stops for that inbox straight away, Sortmail deletes its stored copy of the permission, and on Google it also revokes the permission itself. Microsoft offers apps no way to revoke, so on Outlook remove Sortmail there too (below). The inbox’s sorting history is kept so you can reconnect later; delete your account to remove that as well.
From your provider
Google: myaccount.google.com → Security → Third-party apps. Microsoft: your account’s app permissions page. Removing access there works even if Sortmail is unreachable, which is the point of mentioning it.
What happens to your mail
Nothing. Every label Sortmail applied stays exactly where it is, because those labels are in your mailbox and belong to you. Sorting simply stops.