Can you help?
For international competition play, the ITTF stipulates a minimum court size of 14m long, 7m wide, and 5m high, according to Law 3.02.03.01.
3.02.03.01 The playing space shall be rectangular and not less than 14m long, 7m wide and 5m high, but the 4 corners may be covered by surrounds of not more than 1.5m length.
I know that for the Australian Open tournaments, they often use a 12m long by 5m wide format (and occasionally a 10m x 5m court), which is still a fair bit of space.
Generally, the better the players, the more space they are going to need. Plus defenders typically need a bit of extra space as well, since they often play far away from the table.
For a home table tennis table, it's a bit different. For a family that's just playing basement ping-pong, a couple of meters each side of the endline of the table, and maybe a meter each side of the sidelines should be fine. Since a table tennis table is 2.74m long and 1.525m wide, that would be a room size of about 6.74m long (2.74m + 2m + 2m) by 3.5m wide (1.525m + 1m + 1m). That would be about as small as you could get away with, otherwise you would tend to hit the wall a lot when you try to do a backswing, and you'd find the side walls getting in the way a lot.
As the standard of the players improves, the amount of space they will need will go up too, of course. The height you'll have available generally just depends on what height the room was built with, but the higher the better - and at least high enough so that a tall player doing a slow loop doesn't hit the ceiling or any light fittings! Anything under 3 meters is going to make any sort of lobbing stroke very difficult to play, so I'd say at least a 4 meter high ceiling to allow good players to use an effective topspin lob defense now and again.