Both sentences indicate physical discomfort. The boy and girl in your sentences both felt this discomfort. You can also feel mental discomfort in the form of having experienced psychological stress (ie emotional tension, strain or distress).
If the boy's head hurts, it could be due to either physical or mental discomfort. He may have banged his head (physical discomfort) or experienced mental stress from a headache (mental discomfort).