The critical angle takes place when the ray is refracted at 90º, therefore along the boundary of the second medium. If the critical angle is exceeded, all of the light is reflected. This is known as total internal reflection. On the other hand, the index of refraction determines how much of a wave bends in a certain medium.
The critical angle is related to the refractive index by Snell’s Law:
sin of incident angle / sin of refractive angle = refractive index of medium 2 / refractive index of medium 1
So, for the critical angle the refractive angle will be 90∘. From here you can calculate the refractive index for any medium.