Also, you will be limited by the complexity in connection and routing that comes with increased number of slave devices. The traces too are going to.get longer as slave devices increase.
As others have said as many as you want but SPI doesn't scale that well since you (typically) need individual CS lines for each device. Though SPI GPIO expanders could be used to help address this.
I2C with its addressing scheme scales better. Two lines gets up to 128 devices (though also bus C limited).
I2C is again a separate topic. 127 is theoretical limit. Practically it depends on each device capacitance, speed of the Interface.
Is it a general question.
If it is question related to your design, you can post some design parameters like Max speed, devices etc
For SPI there is no defined standard like I2C, Protocol, number of lines, sampling points everything can be varied.
It depends on a number of slave select lines on the hardware. Example: If my SPI master has 4 slave select lines then we can connect 4 slaves normally.
It depends on a number of slave select lines on the hardware. Example: If my SPI master has 4 slave select lines then we can connect 4 slaves normally.
Or 16 (with additional master /SS line) --> and two HC138
or 15 without additional master /SS line --> and two HC138
or 8 with included ( in the 4) master /SS line --> one HC138