I have seen mechanical (micro switch), optical and magnetic(magnet + hall sensor) end stops.
Are there any differences in how exact they switch at the right location? If so which are the most precise?
I don't think there is a simple answer.
In my opinion, for a home sensor accuracy doesn't matter. Firmware usually allows setting an offset between the indicated position and the actual position. What really matters is repeatability. Every time the sensor indicates position, the position is the same.
I have found through testing several mechanical switches that the "make" event is less repeatable than the "break" event. For best results, I move toward the position that closes the switch, then move in the opposite direction until the switch opens. If I remember correctly, I got "make" repeatability of about 0.02" (o.5mm), and "break" repeatability of about 0.005" (0.13mm).
**Optical Switches **
For a delta 3D printer, I use optical sensors. Optical sensors have a built-in illumination and sensor, usually on opposite sides of a forked structure. The sensor side has a slot which masks the light being received, helping to shroud it from ambient light. The slot is along an axis which is either aligned with the fork or normal to it. The flag you use for the interrupter should completely cover the slot, and for good repeatability edge of the flag must be parallel with the slot. In other words, some sensors expect the flag to enter from the side while other expect the flag to enter from the top. Either will work, but you need to choose the right sensor for the configuration of your machine.
Ambient Light with Optical Switches
Perhaps ambient light could be a problem. If so, it could be addressed by shading the sensor.
Let's assume that the leds in the sensor are the same efficiency as the ambient LED lights. For reference, here is a spec sheet for a typical optical interrupter used in optical sensors: http://www.isocom.com/images/stories/isocom/isocom_new_pdfs/H21A.pdf The package of the optical sensor is designed to reduce susceptibility to ambient light.
Light intensity falls off as distance^2, and the illuminators in the sensor are very close. How much effect does room light have on the sensor?
In my shop, I use 8-foot LED replacement bulbs for the fluorescent bulbs. With this, I have 72 watts of LED lighting, which, let's say, illuminate evenly the semi-sphere below the ceiling. A full sphere is 12.56 sr (steradians, or stereo-radians), so the half sphere is 6.28 steradians, for a power of 11.46 w/sr. At the sensor, this must be divided by the square of the distance, let's say 8 feet. This gives us (11.46w/sr)/(96in^2) = 0.119w/area.
The illuminating led has a power (typically) of 1.2v * 0.05a, or 0.06w. The light cone from a typical LED is about 30 degrees, which is 1 sr, for a power of 0.06w/sr. Scaled for an estimate of the distance between the emitter and sensor of 4mm or .157", is (0.06w/sr)/(.157in^2) = 2.43w/area.
It seems unlikely that general ambient light will be a problem. If it were, the sensor mounting could be designed to shield the sensor from direct exposure to ambient light.
It is important with optical sensors to be sure the interrupting flag is actually opaque to the illuminator light. As I found, red PLA is not especially opaque to infrared light, so I needed to paint the flags with a black pigmented paint.
Hall Effect Switches
I have no experience with Hall effect magnetic limit switches. Other answers here have praised them because they have an adjustment which can be used to set the precise detection point. I don' t like adjustments because they drift. Pots are subject to wear, oxidation, and both slow and fast variation in their resistance. I would prefer to have something unadjustable and repeatable in hardware and use software to hold the calibration.
Example of Hybrid Choice
On a 6-axis delta architecture CNC machine I build, I use a hybrid approach to sensing home position. Mechanical switches indicate a position that is close to home, and the index pulse of a rotary encoder defines the precise home position. the homing firmware moves toward home until the mechanical switch closes, then away until it opens, then back toward home until it detects the index pulse. As there are six axes, there are six sets of these switches and encoders. Using a mechanical switch for the rough homing made sense for this machine because the index sensor is hit once per revolution, so it is not a unique indicator of home, and this machine creates a lot of dust and chips, which could block an optical sensor.
So, without an absolute answer, my preference is for optical switches for repeatability.