exit
quit
@gnubg{} will also exit upon end-of-file; you can therefore exit by typing an end-of-file character (usually C-d, i.e. hold the CTRL key and press D).
If you send an interrupt sequence (often by pressing C-c), the current @gnubg{} command (if any) will be terminated. This can be useful if you do not want to wait for a slow command to complete.