You can leave a workspace that you’re a member of from the Workspace Members page. Click on your profile image on the right top of the app and select your workspace to go to the Workspace Members page.
There, click on your name, navigate to the top of the list and click the “Leave” button.
☝️ Restricted members are unable to access the Workspace Members page. In this case, you can leave projects to which you’re invited individually, but to leave the workspace, you'll need to contact the workspace Owner or Admins. They can remove you from the workspace as explained here.