Quitting Mail is very slow
Check Preferences - Accounts - Mailbox behaviors that you don't have options 'Delete [Sent, Junk, Deleted] messages - when quitting mail'

Also, how many messages do you have? If there are many (like around 10k and above), then I think this is inevitable that you have such app closing time. Probably in this case it is better to reorganize your mails. Probably create some local archive.