Imagine 2 gears (I'm sure you've already done so) with radius R and r respectively. For the gears to work effectively, they must come in contact at the same rate to fit together.
Thus the linear velocity of the two gears must be the same, which implies that in the set amount of time, a single teeth on each gear will travel the same distance. This distance is the arc length of the circle.
So using the formula for arclength, we find that . Now for gears of two different radius, clearly the angles must be different. It's simply a matter of substituting an angle to get the other one, given the radius of both.
Hope this clears up your confusion.