I would say that "unterrichten" exclusively takes place in a formal context, i.e. in an academic institution like a school, or also in a company. "unterrichten" implies the formal transfer of knowledge without caring about the outcome of the teaching process.
Its use is partly comparable to the English "to instruct".
"Der Lehrer unterrichtet Deutsch, Englisch und Mathematik."
(The teacher teaches German, English and Mathematics.)
"Der Chef unterrichtet dich, wie man die Maschine verwendet."
(The boss teaches you how to use the machine.)
"lehren" can have several meanings: First of all, it can be used in a university context to express a higher level of formality. Secondly, it is used for the informal transfer of knowledge or life experience, not necessarily in an academic context. "lehren" implies the continuos, supervised transfer of knowledge or experience, caring about the outcome of the teaching process.
"Der Professor lehrt an der Universität."
(The professor teaches at university.)
"Das Leben lehrt dich zu lieben."
(Life teaches you to love.)
"Die Mutter lehrt dem Kind ein Gedicht."
(The mother teaches a poem to the child.)
If you have any more questions, feel free to ask.