In Visual Studio Code, if you click once on a file, it opens it in a temporary tab. This is helpful if you are looking into a bunch of files searching for something, without opening every single one of them.
If you want to open a file in a new tab that persists until closed manually, double-click on the file.
You can also persist a tab that was previously created as a temporary tab by double-clicking on the tab. Note that temporary tabs have an italicized title, while normal tabs do not.