Men's garments always have buttons on the right side and the front. Women are on the left and sometimes on the back.
During historical periods like the Renaissance and the Victorian Era, women's clothing was often much more complicated and elaborate than men's - think petticoats, corsets and bustles. But while rich men often dressed themselves, their female family members most likely had servants to help them put on their clothes, both out of luxury and necessity. To make it easier for servants to button up their employer's dresses right, clothiers might have started sewing buttons on the opposite side. Eventually, as clothing became more and more mass-produced, women's clothes kept being made with the buttons of the left, and the design became standard.
That's one explanation for why women's clothes button on the left - but why would men's clothes always button on the right? That particular tradition might have roots in how men once dressed for war. Just as wealthy women needed servants to help them get dressed, men's clothing might have taken cues from military uniforms.