Overhaul and repair are two different things.
Overhaul re-sets the maintenance clock to 0 (if you spent enought time in overhaul).
Think of it as some yard time to replace worn out parts of the machinery, replace some wires, install software updates, that kind of things.
Overhauls are done by Maintenance Facilities.
Repairs reapair either battle damage or parts that are destroyed by maintenance failours(sp?), when your ship didn´t have enough maintenance parts to instantly repair the damage.
Repairs are done by your shipyards.
Whenever your ship is over a large enough population, your crew will get shore leave automaticaly, be it repairs or ovehaul.