Earlier everyone had long hair as far as I can see. I wouldn't mind a general answer but I would like to know if possible about my country. India.
As far as I can think I would guess industrial revolution when gender stereotypes solidified and having long hair in the face of a machine that could pull your scalp off was not desirable
You may be interested in this section of our Popular Questions wiki: On men with short hair, women with long hair, and vice versa