I'm not aware of any such extension; but similar questions were asked in the past, and the common (and IMHO sensible) response is to tie postgres authentication into an external authentication provider, e.g. LDAP
Is there an extension that provides password aging functionality? i.e. requires uses to change password after X number of days from last password change.