Interesting question. The Egyptians were building chairs with four legs by 2000 BC., and tables also, so perhaps the answer as to "when" would be, way back there in the mists of time. Why for chairs? Begin with a seat: rectangular fits human anatomy better than triangular or circular. From there it's logical to run a support down from each corner, to hold it up. It's also pretty straightforward to construct something with right angles- easy to lay out, measure, figure out mortise joints, etc. For tables, there's also the need to have people's legs fit underneath. Four legs works pretty well for that, though the basic trestle table has been around at least since the Middle Ages because of common problem with tables: they can take up a lot of useful floor space and aren't always needed. A trestle table probably evolved from placing some boards across two saw-horse supports, which made it easy to take down and store.
But three-legged stools have always had a place, since tripods don't rock on uneven ground. It makes a low three-legged stool ideal for milking cows.
The when appears to be pretty far back in time, well before the invention of writing. We have Egyptian chairs recovered from tombs, and they are very well-developed, so it has to predate at least the 2500s BC (we have four-legged chairs and beds from the mother of Khufu) So our only way of tracking the origins would be to either recover them archaeologically (unlikely if they were made of wood) or to find images of them in art.
I have been able to track down Neolithic period figurines from Romania dating from approximately 4700 BC. Here is one image from a museum, and here is another. According to this book they found a whole bunch of models of sitting furniture, including three and four legged stools. So given that chairs with four legs are so old, figuring out why is more difficult. We don't have any reasoning from the original people. We just have evidence that they were aware of such furniture. My personal guess (and I emphasize that it is in fact a guess) is that four legs was the most logical option, as one can take a flat piece of wood and set it on four legs, one on each corner, and it was the most stable of all the various supporting options.
As for tables, I believe they are similar in age, though I am not aware of table images older than the contemporary Egyptian examples above. The Egyptians used several types of tables, including four legged tables as well as three and even one-legged tables (one legged seems to be very common from the paintings that I have seen). This is a 4th or 5th dynasty image of a ruler on a throne with a pretty much ubiquitous one-legged table nearby. There are certainly plenty of 4-legged tables as well, though, as can be seen in this image here.
We have examples of chairs and tables with 4 legs (reinforced) from the Ur III period of Sumer (~2100 BC)
So the TL:DR is that furniture with 4 legs is in fact very old, but has not always been a "convention", per se. Other options have always been available alongside 4-legged chairs and tables.