Mail stopped working today, saying this app doesn't fulfill the current security measures by Google. So I can't use Mail with my Gmail account anymore.
My Google Settings looked a bit different, so just do an internet search on "Google App passwords", and you will find the right place.
Before that, you need to delete your account from "Internet accounts" in the system preferences. Then proceed to create a new mail account in Mail (after deleting your old accounts). This time, don't chose "Gmail", but "other account" instead.
Then go to the Google App Passwords, create an App Password, and then enter it in Mail.