How to close all query windows in DBeaver?
You can right-click on any tab then choose "Close All":



In order to automatically close database object editors when exiting the application, you can uncheck this option: "Reopen database editors after restart":



Note that this will only close database editors (tables, schemas...) and it won't affect text editors. There's currently (DBeaver 5.1.2) no option to automatically close text editors when exiting the application. The feature request is tracked on this issue.