Ue-sama mode (お上様モード), also known as the Maou mode, is who Yuuri turns into when he's angry. Yuuri only uses his water Majutsu when he turns into Uesama.
His first appearance takes place in Episode 2 of the anime, and at the end of Chapter 6 of the first novel, after Yuuri believes that a maid was injured by Wolfram's fire Majutsu. In the novels, Uesama's first word, inside Yuuri's head, is "Finally".
Ue-sama has longer hair in the anime, but not in the manga. In the manga, Yuuri's physical appearance remains the same, only his eyes look more "demonic". Since Yuuri is into historical dramas, Ue-sama speaks like a judge from those dramas. Once Ue-sama decides on the punishment he'll inflict on the criminals he writes "judgement" (成敗 seibai) onto something. Usually Yuuri passes out after this and can't remember what happened. At the beginning he used to pass out a lot, but later on, whether he passes out or not will depend on the amount of Maryoku (demonic power) that he used.
According to the novels, Yuuri has always had a short-temper. This started around the time when he was in the 4th grade, and he got angry at his music teacher and just start rambling until he could think of something to say to her (this resembles Uesama rambling before passing judgment). His short temper also got him expelled from the baseball team, after he punched his coach after the coach told one of the players he should quit because he wasn't good enough.