The question is, when i press f5 and try out the program it writes the files correctly, but when i close, do the files get deleted?
No. The files are only deleted if you delete them.
where does the file get stored? will the file remain there for reading if i close the program that was running in debugmode (F5) ?
Most generally, when you don't specify paths, files are written in what the process considers its working directory. You can set the working directory with:
System.IO.Directory.SetCurrentDirectory(path);
The working directory for your project can be set in the project settings.