Some jurisdictions may have actual laws governing this ... but the one I live in doesn't. The only limit to how many middle names you can give is the doctor - if the doctor filling out the paper work deems a name unfit, or thinks it will cause the child problems, then the parents have to take it to court if they want to press it. This could conceivably be done if the doctor thinks the child has too many middle names .... however, as an adult, there are no limits. You can go to the court house and petition for a name change and, so long as the judge believes you're not doing so for illicit reasons, you can add as many as you want.
As a side note, I do know a girl with 5 middle names. She had four and birth, and then had her Hebrew name (she's Jewish) added to her legal name as an extra middle name when she got old enough.