You must have 2-Step-Verification enabled before setting up an application password.
- Visit your App passwords page. You may be asked to sign in to your Google Account.
- At the bottom, click Select app and choose the app you're using. You can also select Other and enter you own custom app name.
- Click Select device and choose the device you're using. You can also select Other and enter you own custom device name.
- Click Generate.
- Be sure to copy the password that was generated. When using the password, do not use spaces.