You can set a unit to auto-produce in the City menu or Country menu. Whenever you have available units, this unit will be built (provided you have enough money). City lists in the country menu and the Cities menu ('star' in the top toolbar) show available units or auto-produced unit. Clicking on the unit icon will cancel the auto-production.
There's also an auto-production tab in the Cities menu, where you can cancel all auto-production, put it on hold or execute all orders.