In the "Code, planning, and automation" section of the sidebar, click Repositories.
Next to the repository you want to leave, click Leave.
Read the warning carefully, then click "I understand, leave this repository."
Removing yourself from a collaborator's repository
If you no longer want to be a collaborator on someone else's repository, you can remove yourself.