The Extract Variable refactoring wraps the selected expression into a variable. It adds a new variable declaration and uses the expression as an initializer. To invoke this refactoring, select the expression and press &shortcut:IntroduceVariable; (Refactor | Extract | Variable):

extract variable