There are several ways to exit Cimagraphi:
Click the application window's control menu on the main window, in the top-right corner.
Press Alt-F4 from the keyboard.
Select File → Exit from the application menu.