If you create a new document and start attaching files to it, temporary attachments are created. When the document is saved, the temporary attachment becomes a real attachment. If the document is not saved, the temporary attachments remain on the disk or in the database. To handle the unused files, there is a scheduled task pre-defined.
In Site Manager -> Administration -> Scheduled tasks, you can find the Delete old temporary attachments scheduled task. By default, this task is performed on a daily basis and deletes all temporary attachments older than 24 hours.
You can customize the interval by adding the <add key="CMSDeleteTemporaryAttachmentsOlderThan" value="1"/> key into the <appSettings> section of your site's web.config file. The value specifies the interval in hours.