There are two easy ways, and both work fine.
Open your Social menu (bound to O by default) and switch to the Guild tab. Left-click your own name in the roster, then choose "Leave Guild".
Type /gquit in chat. A confirmation window appears; click yes and you are out.
One thing worth knowing: leaving is instant and does not come back. If you are guild master, you have to hand leadership to someone else first.