That law is usually related to hunting regulations. They limit the number of rounds that you can fire in the spirit of giving game a sporting chance. In some states like Kansas upland hunting doesn’t require a gun plugged to only accept 3 rounds, but Fed water fowl regs still require 3 shots except in special situations.
For self defense there may be some local regs that you would have to check for your area that limit round count but generally you can have as many rounds as your gun will hold for self defense.