Once out, turn left (Link's left), then in the corridor, watch out for the Gerudo guard in the back. Pick up the Small Key, free the prisoner, talk to him and go on. Be careful, don't let her hit you with a spinning attack or you will have to start back from the jail. Talk to the carpenter in the cell, then fight the Gerudo thief with the Biggoron Sword (or Master Sword). Then, jump to the bottom and take the passage on the left. In the jail, look at the ceiling and fire the Longshot at the plank to drag yourself to the opening. Go straight ahead and you will get caught by guards. You can cross the bridge with Epona or by using the Longshot.
Go back to the Hyrule Field, call Epona, then gallop to the Gerudo Valley, west of the field. Ocarina of Time walkthrough Gerudo Fortress and Thief Hideout