What is the grammatical name in the two sentences:

1. I stopped running when I saw my friend.
2. Annie gets excited whenever she sees a dog.

Please define "grammatical name" for me, and I might be able to help.