A bumper is "coming in" or "going out" music and is generally longer than a stinger, maybe around 15 seconds or so. Typically used going to or coming from commercials.
A stinger is a short snippet that usually (but not always) has a sharp ending and could be used in a show to highlight the end of a scene, a show like Scrubs or Seinfeld uses stingers all the time. Typically only a couple of seconds long.
Everything Mazz says is how I think of bumpers and stingers as well. If I had to add anything I would say a stinger can also be used to end a piece of music. You might have several versions of a song or loopable song and the music editor can use a stinger on any of the versions to end the song.
It runs from around 00:02 (When you see "Corning, Arkansas") to 00:07 seconds in this clip. A good button ending is almost always the key. (Thank you Keith L. for this one!)
TV News shows are a good place to hear lots of bumpers and stingers.
If I'm thinking TV use, I'll usually make these versions of a song:
Full length
Full length, instrumental (sparse) underscoring bed
:60 (actually 59.5)
:30 (29.5)
:15 or :10
:04 or :05
I think of Stingers as musical "exclamation points," whereas Bumpers are like ellipses followed by a period . . . a more gradual approach to the ending.
,
Suz
P.S. Company IDs (e.g. production company names/ logos that appear before the beginning of a movie) are usually about 10 seconds long.