Gul Madred more or less stated that the Military came to power during his lifetime. Assuming he was the same age as his actor, David Warner, who was about 50 at the time, this would suggest that it happened about 40 years in the past.
According to Memory Alpha, the Occupation of Bajor by Cardassia ran from 2319 to 2369. That is 50 years. Cardassia maintained a military presence 10 years prior to this. Cardassia was militaristic and hostile, annexing star systems by force years before establishing a military presence on Bajor.
Simply having a military presence on another world doesn't mean you're a Military Dictatorship. The time the annexation formally happened was probably around the same time the Military took over Cardassia, given how close Bajor and Cardassia are.
So the military takeover was 50 years ago, and probably there was resistance to this on Cardassia which explain Madred's impoverishment as a youth until when he joined the Military (around when they truly consolidated their power over Cardassia and stamped out most resistance).