Jokes are great, aren't they? My first blogfest dealt with the joking nature we all have in us. Everyone has a friend that can tell a great joke and make us laugh, so why shouldn't we all have that one character who can do the same?
Jokes add levity to a serious situation, but can be inappropriate as well. Sometimes, you find yourself in a situation with a few people where they are having a "my horse is bigger than your horse" situation. Everything is going great, people are laughing, and then BOOM! Someone says something that one person finds offensive and its all over.
Writing jokes for your characters can do the same thing. You can use jokes in any situation but you should remember a few things while you do this:
1) How will the readers take the joke?
2) How will the other characters take it?
Another way to incorporate jokes into your story is to have a character that is lousy with them. I, for instance, love to tell jokes, but until I get them down, I usually stumble through, use the punch line too early and lose the interest of the people I'm telling them too. Granted, that alone can be hilarious to someone else. I've had people laugh at my expense for failing a joke, and that can happen to a character too. How would they react to that? Depends on their personality.