Short answer: No law requires you to accept or preserve resumes or applications if there are no available openings.
Long answer: As a best practice it is recommend deciding up front whether you will consider any unsolicited applications. You may choose to refuse to accept unsolicited resumes entirely and refer applicants to your posted openings. If you choose to consider some unsolicited applications, however, you should keep all unsolicited applications for one year after receipt or decision not to consider. "Cherry-picking" or accepting and preserving unsolicited resumes inconsistently can easily lead to disparate treatment claims with the EEOC or a state agency. If your decision of who was hired from that pool was ever challenged, it will be hard to defend your position without any documentation.
When you accept resumes or applications in relation to a job posting, the resumes should be maintained for one year from the time of your hiring decision for compliance with an assortment of laws. Federal contractors should maintain these records for at least two years.
The amount of communication with applicants you do is entirely up to you and what you want. I recommend explaining in your job postings what amount of communication applicants can expect. As a general rule, no contact is needed for unsolicited resumes, and it’s usually not expected. No contact is required in response to submitted applications, although applicants at the later stages of the process will expect some kind of notification (email or letter) as a courtesy. Please note, however, that government contractors also have different rules regarding communication with applicants.
While responses are not required, leaving applicants who do not get the position with a positive feeling helps create a positive reputation for your company, so we recommend doing so to the extent you can.