Are you sure that your steps per mm are set correctly? Is the problem that it stops before hitting the z axis switch or that it doesnt stop when it does hit the switch?
If you need some help, or don't understand what I just said, feel free to send me a PM anytime
Printer: Prusa i3, 2 E3D v6 Hotends, Arduino + RAMPS 1.4 with a Bypassed 5V Regulator, 400w Insignia ATX PSU, Custom Designed Bowden Extruders