Here's why:
* "When I get home from school" is a subordinate clause indicating the time when the main action will happen.
* "going to take a nap" is the main clause and describes the future action.
The use of "going to" is a common way to express future intentions.