The max amount of mortgage you are referring to @Colby Adkins has to do with personal residential mortgages. I think the limit is 8-10 per person. When you hear of 50 units or more, there are other loan products and opportunities available for individuals to scale, including commercial loans, blanket loans, portfolio loans, private money, hard money lenders, etc. After you max out, you have to get creative!
It sounds a bit counter-intuitive. Say you get ten mortgages in your name and your spouse gets ten mortgages in their name. Sounds like 20 units, right? Well, what if they were all duplexes or included some triplexes? Now you're up to 40+ units/doors and still not above the ten mortgage/person limit. Some people will also not use conventional financing - e.g. use a HELOC on your primary residence as the "mortgage" on the rental. Some people don't pursue FHA-approved loans - i.e. the lender can't sell the mortgage so this limit wouldn't apply.
After they hit their limit, my understanding is that people use the options that @Dan Barli mentioned - e.g. portfolio loans.
To be clear, I'm not advocating any particular strategy. Simply stating how some people orchestrate their investments.
For clarity, the law has nothing to do with it. There is no legal limit to the number of deals one can do.