It depends, on the hardware and to some extent also driver and firmware. The AP (and that goes down to the wireless hardware) needs to account for each connected client, reserve some (partially on-chip-) RAM for each connected STA and keep track of them (including buffering for power-saving clients), that limits the number of concurrently connected clients way before the theoretical limits. Then you also need to consider the mere availability of airtime slots, especially with older STAs in the mix (even if you don't have any, unless you're running in greenfield mode the AP still needs to account for older clients) - before even thinking about interference from your neighbours.
In the 802.11g/n days, the practical limit (independent of the hardware) was indeed somewhere in the lower- to mid thirty range, just because of beacons and responses from connected clients filled up the airtime (without any active traffic) leaving no space for additional clients (aside from the effects of the remaining achievable per-device throughput, your frequency band is simply shared by all devices, including those of your neighbours). With 802.11ac and 802.11ax these limits have been pushed considerably (into the low hundreds at most), but they're still there (and any older STA in range and up to three times the range you can see, has a negative impact on the system as a whole).
In case of ath10k-ct, you can fine-tune to the number of possible STAs (by reshufflling ressources from other tasks), other chipsets may have fixed limits (which are rarely documented), e.g. ath9k_htc has (depending on driver/ firmware version) a hard limit between 4-8 connected STAs (the on-device RAM simply doesn't allow more space).
The enterprise solution of this problem is hardware, more APs, tuned-down tx-power, Mu-MIMO (802.11ac/ wave2 and upwards) semi-directional antennas and a clever spatial distribution of APs, channels and active client-steering.