Even when you live in a city, you have to walk: you have to walk from the station to your destination or when to change trains.

About the part in bold, I think what the author is trying to say is 'when you change trains', but is that 'when to' grammatically acceptable?
Yes, your interpretation is right; no, it isn't grammatically acceptable.
[...to your desination or to the transfer station.]
TakaI think what the author is trying to say is 'when you change trains',
Yes, that's most likely the intent.
Takabut is that 'when to' grammatically acceptable?
Not here. No. when to clauses are indirect questions, hence, they function as noun phrases:
I didn't know when to change trains.
Be sure to tell him when to change trains.
They don't function as adverbs:
*You have to walk when to change trains.
*Be sure to read the posted signs when to change trains.
Site Hint: Check out our list of pronunciation videos.
I thought not. Thank you both!

Can I ask something related to that matter?

Would you native speakers use 'wh~ to/how to' as a subject of a sentence?

What to do is a problem.
Taka'wh~ to/how to' as a subject
Yes. No problem.
How to prune roses is the topic of the lecture.
When to start the academic year was a matter of great debate.
Where to put the suitcases became the main concern when we realized there were hundreds of them.
One of the books I have says 'wh~ to/how to' is rarely used as a subject, so I was wondiering if it was that rare.
You don't think it's rare, Jim? 
Students: We have free audio pronunciation exercises.
I suppose if you consider the millions upon millions of sentences in English, there aren't many with that stucture as subject, so it's rare. It seems to me that it can only occur comfortably with a linking verb, so that also limits its usage.
OK. Thanks, Jim!