Go to the Run menu and select Edit configurations...
Select the configuration you've been using to run your project in the left panel. Either it's the Gradle yourProjectName:desktop [run]
task, or it's an Application run configuration you've created yourself.
Uncheck the box that says "Allow parallel run".
The next time you try to run it when it's already running, it will warn you that it can only run it if it kills the old process. You can check a box in this dialog to do that automatically from now on.
I've never figured a way to toggle this behavior back to how it was, but I've rarely ever needed to compare two builds side-by-side.