I suppose it boils down to java heap size available on the system. Heap is the memory space where memory is allocated to java objects. Hence there may not be any universal answer of your question as it depends on how much heap size would be available for classes. And then as many tests (which in turn contain classes or packages) can be provided in testng.xml file.
Does it answer your question?
~ seleniumtests.com