When you ask for something over and over AND over again, you are nagging. If you nag your parents long enough, they'll either give in and get you a puppy, or simply refuse any pets at all — not even a goldfish.
When you nag someone, you complain and pester them. Your teacher might nag you about a late assignment, or you might nag your friend to give you back the sweater he borrowed. A thought or worry can also nag you, simply by staying in your thoughts. The word nag meant "gnaw" before the 1820s, from a Scandinavian root.