1) The neutral and the most common word order is "С кем я пошёл?".
2) "Я пошёл с кем?" most likely will be used as rhetorical question, when the speaker doesn't really expect an answer from other people, but answers the question himself. "С кем" should be emphasized with intonation. Examples:
1.
Я пошёл с кем? С тобой, конечно!
Whom did I go with? With you, of course!
2.
Вектор a направлен куда? Правильно, перпендикулярно плоскости XY.
Where is the vector a directed? That's right, perpendicular to the plane XY.
3) Пошёл я с кем? can be used to emphasize "пошёл", typically when it is opposed to some other action. For example:
Я помню, что разговаривал с несколькими людьми, а пошёл я с кем?
I remember that I talked to several people, but whom did I go with?
4) "Я с кем пошёл?" is similar to variant 2, it also emphasizes "с кем".