[subject] + [verb] + 了 + [pronoun] + [duration]
[subject] + [verb] + (了) + [duration] + (的) + [object]
[subject] + [verb] + [object] + [duration] + 了
A length of time after the verb says how long something went on. The basics – verb copying with an object, 的, and the second 了 for "still going" – are in the duration point. Two cases work differently: a pronoun as the object, and a verb that happens in an instant.
When the object is a person – 我, 他, 你们 – it goes straight after the verb and 了, and the duration follows it.
An object that is a thing still goes after the duration: 我看了一个小时书.
来, 到, 毕业, 结婚, 离开 and 认识 happen at a point; they can't last an hour. A duration after them counts the time since it happened. The object comes before the duration, and a 了 at the end says the count runs up to now.
多长时间 and 多久 go in the slot where the duration would be.