When the metal is cold, the molten solder freezes up as it touches it, making electrical contact but not really sticking. So sometime later, as a result of thermal expansion or mechanical flexing, the solder joint becomes unstuck. This is called a "cold joint".
It's also essential to use flux when soldering. Most solders used in electronic hand-soldering have a rosin flux core in the middle. The rosin melts first onto the metal you're heating, preventing the heat from forming an oxide layer so the solder can bond to the metal. (I think the flux also helps break down any existing oxide layer, not too sure on that part.)
This teacher's technique would result in unreliable cold joints all up and down the pins.
Search for "cold solder joint" for more information and photos of cold joints.