You're on the right track. is an interrogative, a question word. It's used to ask when something happened or will happen, not to talk about a particular time period. In English, we say:
> _When_ I was in high school.
In Japanese, it's:
> __
(There's nothing wrong with saying ; it's just a little less common, probably because it's an extra word. In English, you can say, "Back in high school" or "When I was in high school" or "When I was a high school student...")
and are never interchangeable. For example, you can say:
>
When is the class? If you replaced with , the sentence would make no sense.