This website has the longest URL allowed by the domain name registry

You are right that the subdomains are usually not counted as part of the domain name.

However, URL is a different term again, and this is not the maximum allowed URL length, the part behind the TLD (.com, .me, etc) can easily make the URL twice as long again. I believe the part we are talking about here, including the subdomains but excluding the “on the server path”, is called the hostname.