I'll certainly go a long with what Randy and Samantha say. But to me I think pupil refers to being in relation to a teacher rather than your activity. For example if you are a university student and someone asks what you do you can reply 'I'm a student' but it isn't clear to answer 'I'm a pupil'. On the other hand if someone asks the same university student do they know Professor Smith they may answer 'yes, I'm one of his pupils'.
For a teacher you can talk equally about them having students or pupils. Someone doing autodidactic self study is a student but not a pupil of anyone.
So in this way it is probably applied to younger students more. I'm not sure if this is just a convention or because when you talk about younger students it is more important that they are under the control of a teacher than the academic activity they are doing.
Not sure if I added anything you didn't know.