Breakdown of Hun har undervist på universitetet i fem år.
Questions & Answers about Hun har undervist på universitetet i fem år.
To say how long something lasts in a positive sentence, Norwegian uses i: i fem år (for five years), i to dager (for two days). Using for here is a very common slip for English speakers, since for exists in Norwegian too, just with other meanings.
Notice that this only applies to positive statements. If the sentence were negative, i would switch to på: Hun har ikke undervist på fem år (She hasn't taught for/in five years).