In this paper, we propose the notion of dynamic deviation measure, as a dynamic time-consistent extension of the (static) notion of deviation measure. To achieve time-consistency, we require that a dynamic deviation measures satisfies a generalised conditional variance formula. We show that, under a domination condition, dynamic deviation measures are characterised as the solutions to a certain class of stochastic differential equations. We establish for any dynamic deviation measure an integral representation, and derive a dual characterisation result in terms of additively $m$-stable dual sets. Using this notion of dynamic deviation measure, we formulate a dynamic mean-deviation portfolio optimization problem in a jump-diffusion setting and identify a subgame-perfect Nash equilibrium strategy that is linear as function of wealth by deriving and solving an associated extended HJB equation.