Let's look at a sentence and try to figure it out:
まり子さんは真一さんが何さいのとき生まれましたか。
(Mariko-san wa Shin'ichi-san ga nansai no toki umaremashita ka.)
The translation of this sentence is:
"How old was Mr Shin'ichi (真一) when Ms Mariko (まり子) was born?"
(umareru = to be born, -sai = years old.)
This sentence combines two clauses using 'when':
- How old was Mr Shin'ichi?
- Ms Mariko was born.
Let's look at the sentence again. I put clause 1 between ( and ), and "when" between [ and ].
まり子さんは(真一さんが何さい)[のとき]生まれましたか。
Mariko-san wa (Shin'ichi-san ga nansai) [no toki] umaremashita ka.
The first thing you'll notice is that 'when' is applied to clause 1, not to clause 2: the subclause is 真一さんが何さいのとき, which translates to 'When Mr Shin'ichi was how old?' So where we would normally say in English, "How old was S when M was born?", the Japanese literally says, "M was born when S was how old?" The reason we're not given the normal order is simply because we haven't learned that yet (a verb followed by とき is in the next chapter of the book). But I checked with a native speaker, and both sentences mean the exact same thing, he says.
The second thing to note is that the subject of the subclause has a が after it, instead of a は. If this was a standalone sentence (like sentence 1 above), it would translate into Japanese as 真一さんは何さいでしたか ("As for Mr M, how old was he?"). But when it's used as a subclause, the は turns into a が. This helps you to identify 真一さん as belonging to the subclause, not the main clause. In this case, it's pretty obvious anyway, but it still helps you to place the ( and ), so to speak.
The third thing is that there is a の between 何さい and とき. We've just learned that のとき follows nouns only, so that must mean that 何さい is strictly speaking a noun or noun phrase. Literally, it doesn't mean "how old" (an adjective, which you might expect from the -い at the end) but more something like "how many years" (a noun phrase).
Three pretty important points, and both the book and our sensei just skipped right over them.