Let's be clear what OS and machine you have but email can be in an app (Apple MAIL) or web mail like Gmail so to archive we'll have to get all the details.
All that aside TWO steps.
1. https://www.google.com/search?q=applescript+to+archive+mail for the archive.
2. https://stackoverflow.com/questions/31955748/how-to-run-applescript-at-scheduled-time to schedule it.
Is there any tool that can archive emails automatically to my PC? The ones I tried, only offered Manual archiving.