Since by the sounds of things you grew up in Germany, you might consider that broadly speaking, the situation is similar to contractions with German prepositions (e.g. "in dem" vs "im", "von dem" vs "vom", "unter dem" vs "unterm"): they occur to some extent in writing, but which precise contractions are appropriate in which writing context is a combination of personal preference, degree of formality, purpose of writing...
Using contractions perhaps gives the impression that the writer is 'conveying information to you in a straightforward manner', and so contractions are perfectly common and acceptable in many written contexts such as manuals, newspaper and magazine articles, advertising brochures etc.
They are usually avoided in a text that wants to convey an imperssion of being "scholarly"[*] or "very formal and authoritative" (e.g. legal contracts).
I can't really reconcile the stance of your teacher in Singapore with actual usage. I suggest two possibilities:
(a) your teacher is incompetent (or at least not being entirely honest about the limitations of their knowledge);
(b) your teacher knows deep down that contractions are used in writing, but they're taking a practical stance of "teaching a simplistic rule that won't lose you marks in an exam"-- I don't know what language exams are like in Singapore, but if they're anything like they are in the UK, it wouldn't be the first time that an exam tests against a grossly simplified and artificial, idealised version of a language...
[*] Although actually even in scholarly journal articles, contractions aren't necessarily outlawed.