There are no rules prohibiting a defender from catching a pass, defenders are actually eligible to catch any ball that is thrown. Defenders (in most cases the defensive backs) actually try to predict where the quarterback is throwing the ball in order to catch it.
When a forward pass thrown by a player on the offense is caught by a defender, it is called an 'interception', or they 'intercepted' the pass. An interception is counted as a turnover for the offensive team and a takeaway for the defensive team. When the ball is intercepted, the defensive player can return the ball in the opposite direction to the opposite team's end zone for a touchdown. This is called a 'pick-six'. If the defender is tackled with the ball, they are called down and their team's offense will take over the football.
If the pass is thrown behind the quarterback or knocked out of the quarterback's hands and caught on the fly by a defender, it is considered a fumble. Just like an interception, the defender may return the ball, and if they are tackled than the change of possession will occur.
Recently in the NFL a trend has emerged for defenses to celebrate an interception as a team. The members of the defense run towards the end zone, get together, and strike a pose for an imaginary camera. The trend was started by the New Orleans Saints and has been used by just about every team since.