Click on the desired folder with the right mouse button.
Select Properties… from the menu.
Go to the Retention Policy tab.
Make sure Use server defaults or Use my account settings is not checked.
Check either Delete all but the most recent xx messages (or Delete all but the last xx messages) or Delete messages more than xx days old.
Typically, make sure Always keep starred messages is checked; this allows for an easy way to preserve emails.
Enter the desired time or message count.