Temporary preview files are generated whenever you use the internal preview. These files are deleted automatically after you close the document. So you do not have to worry about them, they are deleted when you finish the work.
To avoid generating these files, you should avoid using the internal preview.
Note: When you select temporary file folder in Preferences, it is used for non-saved files only, for already saved files the temporary preview files are created in the same folder where the original files reside, otherwise it would be impossible to render a correct preview.