Until today, when you were setting up a cloud password on Office 365 or Azure Active Directory (AAD), you were not able to use more than 16 characters.
NOTE this limitation did apply to synchronized password.
Now, this limitation has been removed; you can set your password by using up to 256 characters, with a minimum of 8 characters.
You can have the complete cloud password requirements here https://docs.microsoft.com/en-us/azure/active-directory/authentication/concept-sspr-policy#password-policies-that-only-apply-to-cloud-user-accounts