Intellij IDEA will automatically create a run/debug configuration when you run any item that doesn't have a permanent run/debug configuration already present.
You can then save the run/debug configuration that was generated to make it permanent.
When you save a configuration, where is it saved?
run/debug configurations for a project are stored in the .idea/workspace.xml file inside the project location. You can see those entries under the <component name="RunManager"
node if you search for "RunManager" in that file.