Puzzles in role playing games can be quite controversial. Personally I feel that they can encourage communication, provide a nice change of pace and are rewarding for players to solve. There are, however, some pitfalls to watch out for.
Every player has different tastes, and the first thing a dungeon master should consider is whether puzzles would appeal to them. Some players just don't enjoy puzzles. You can never please everybody all of the time, but try to make sure that the majority are interested. It doesn't create a good playing atmosphere if most of the players are sitting back and waiting for others to do all of the work.
One issue with puzzles in a role playing game is that players are supposed to be playing a character, but the character isn't really the one solving the puzzle. It's not good for immersion if an intelligent and wise wizard is unable to solve a simple logic puzzle while a dumb barbarian solves it effortlessly. This problem can be alleviated somewhat by granting bonuses (or penalties) based on a character attributes. For example, a perceptive character may notice that a forgetful guard has scrawled some basic instructions on the floor in chalk.
Remember that while your puzzle may seem perfectly logical in your mind, other people may not interpret them in the same way. Riddles, especially, have a tendency to have multiple correct solutions. Players won't be very happy if you disallow an answer that is technically correct, just because you hadn't thought of it beforehand. Try to find someone outside of your group to test puzzles with and be lenient with good answers that you may not have anticipated.
Requiring the completion of a puzzle to progress can quickly kill a session if it is badly designed or too difficult for your players. Give the party incentive to complete a puzzle, but failure should never stop a game. If your players are making no progress but are particularly stubborn and don't want to give up, then consider setting a time limit or having a patrol interrupt them to keep the session moving.
Try to make sure that your puzzles make sense in the context of the game. Finding a sudoku puzzle in a natural cave full of spiders is quite silly, whereas deciphering a set of runes in a wizard's tower is believable. It can be challenging to create or find good puzzles, so don't waste them; wait for the right time and place to use them and they'll be far more memorable.
Despite so many potential problems with puzzles in role playing games, I feel that when implemented correctly, they can really enhance a game. Just try to know your audience, test the puzzles in advance, and be fair.