Without getting into the complexity of pitch diameters of gears, here's an approximation that will get you in the ball park.

Assume

L = distance bolt must retract to allow gate to be opened
N = desired number of revolutions of wheel needed to retract bolt

Then the circumference of the gear attached to the wheel, C, must be approximately

C = L / N

and the diameter of the gear, D, must be

D = C/pi

Rack and pinion assemblies are commercially available but they are likely to be expensive. Think about making your own.