|I take it you are talking about USB ports and not RS232 serial ports or parallel ports. or Ethernet ports.|
Theres is no inbuilt limit to how many port to can connect but each port will require its own interrupt and memory space. Sooner or later you are going to run out of interrupts.
The 127 is the theoretical limit of the number of devices you can connect to single hub. You are likely to run into problems before you get anywhere near that number.
Each hub can only supply a maximum of 500 mAs and each device will need its own memory space for I/O. So a lot depends on the nature of the devices you are connecting.
As most computers these days have at least 6 USB hubs and sometimes a lot more. if you slit the devices between the available hubs via a plug in hub then you should get 48 devices connected but make sure it is a powered hub.
The only way to tell is to suck it and see. See how far you get before something starts complaining.