I think that the imperfect is used to an action developed along the time in the past. But this amount of time is indeterminate. The preterite is used to an action developed in the past but in a determinated time or date. You know when this started and when finished. It's difficult to explain. I thing that the best is read and understand examples. And remember, "fui" is the preterite of the verb "ir" too.