You can leave your alliance by going to the Alliance menu then the Options tab and pressing the Leave Alliance button.
Alliance leaders must first pass the leadership to another member before they are allowed to leave. They can also disband the alliance to destroy it entirely.
You cannot join two alliances at the same time. You must leave your alliance before joining another. After leaving an alliance you must wait 24 hours before you can rejoin the same alliance.