How long does it typically take for gangrene to develop in a leg after a gunshot?

Depends. Gangrene will only set in if the bullet hit and cut off the circulation to one of the main arteries. Every situation is different and without knowing where the bullet hit and which arteries were injured this question can not be accurately answered. Another and perhaps more important question is: can you move your leg/foot and do you have sensation. If yes, the your foot/leg is viable.
Not typical. It is not typical for gangrene to develop with most GSWs. Dead tissue or certain aggressive bacteria can lead to gangrene. And this can be with Hours to days to weeks. Follow with a surgeon experienced in GSWs to avoid developing it in the first place.
Bloodflow problem. Gangrene develops when tissue is not receiving adequate bloodflow. That tissue is dead or dying. Time for that to happen is variable. Infection is also a factor.