Hi @uja2223 ...
If you are the instructor of a Canvas course and you are attaching files to content pages within your course, those files remain in the course for your students ... unless, for some reason, you were to remove the file(s) from the page.
Or, are you asking about files submitted by students as part of assignment submissions? Any files submitted by students for assignments are stored in their user files are of the course, and they are not counted towards their user file quota (which is around 50 MB). Those files cannot be deleted from their user files.
I'm not sure if I am completely answering your question or not. Please help to clarify if I haven't addressed your question...thanks!