Running it twice is an agreement between players to deal the remaining streets twice after two or more players go all-in. Each deal rewards the winning player one half of the total pot. Running it twice is a form of insurance to minimize bad beats, adjust variance, and prevent large bankroll swings.
You can only run it twice in cash games, never in tournaments. Also, some casinos will have different rules, varying from disallowing them entirely to allowing you to run it twice or even three times. Many casinos will not allow it if there are more than two players all in.