Manual:$wgBlockCIDRLimit

Default values
Note: This setting does not control Extension:GlobalBlocking. Regardless of this setting, GlobalBlocking can block IPv4 ranges up to /16 only, but has no limit on IPv6 range sizes.

Details
Maximum CIDR range when blocking an IP range.