Hi,
The maximum number of security groups a user can be a member in windows active directory is 1024.
So, if a user is a member of more than about 1,010 custom security groups, the total number of SIDs can exceed the 1,024 SID limit.
For more details you can refer to: https://learn.microsoft.com/en-us/troubleshoot/windows-server/windows-security/logging-on-user-account-fails
The maximum number of security groups a user can be a member in azure active directory: A user can be a member of any number of groups. For more details you can refer to: https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/directory-service-limits-restrictions
Best Regards,