How do I disable admin password expiration in Magento 2 via the Admin Panel?
Go to Stores → Settings → Configuration → Advanced → Admin → Security in the Magento admin.

In the Security section, locate Password Lifetime (days) and Password Change.
To completely disable password expiration, clear the Password Lifetime field.

Optionally, set Password Change to Recommended (instead of Forced) if you prefer optional reminders.
Click Save Config and clear Magento’s cache to apply the changes

How can I disable it using the command line (CLI)?
To fully disable expiration:
bin/magento config:set admin/security/password_lifetime 0
To recommend password changes (not enforce them):
bin/magento config:set admin/security/password_is_forced 0