Ding is often used as a replacement for saying "That's what she said." It originated from a person ringing a bell whenever such a statement was necessary.
When talking about a test...
"Man, that was hard!" -Person 1
"*Ding*!" -Person 2
When talking about a hotel room card...
"Put it in and pull it out quickly."
in mmorpgs, esp. WoW, *ding* is used to notify others in your party/guild/etc. that you have just leveled up
randomly while playing in the chat log:
player A: *ding*
player B: congratulations