When associated with a character in a play or movie, this is called a leitmotif. It's a short but distinctive arrangement used to recall the character. For example, Darth Vader's is The Imperial March.

When used on a TV show, it can serve to briefly explain the show's premise (say the Gilligan's Island theme) or it can be a punchy soundtrack cut to run behind the credits (say Buffy the Vampire Slayer or Melrose Place).