When you try to impress someone by mentioning a famous person you once met or caught a glimpse of, you namedrop.
If a celebrity's name comes up naturally in conversation, it's fine, but if you namedrop by artificially inserting the famous name — bringing up the story of the movie star you saw at the library over and over, for example — it can become annoying. Namedropping is a way of showing off, trying to impress someone or prove your own superiority.