  We propose a new form of the Second Law inequality that defines a tight bound
for extractable work from the non-equilibrium quantum state. In classical
thermodynamics, the optimal work is given by the difference of free energy,
what according to the result of Skrzypczyk \emph{et al.} can be generalized for
individual quantum systems. The saturation of this bound, however, requires an
infinite bath and an ideal energy storage that is able to extract work from
coherences. The new inequality, defined in terms of the ergotropy (rather than
free energy), incorporates both of those important microscopic effects. In
particular, we derive a formula for the locked energy in coherences, i.e. a
quantum contribution that cannot be extracted as a work, and we find out its
thermodynamic limit. Furthermore, we establish a general relation between
ergotropy and free energy of the arbitrary quantum system coupled to the heat
bath, what reveals that the latter is indeed the ultimate thermodynamic bound
regarding work extraction, and shows that ergotropy can be interpreted as the
generalization of the free energy for the finite-size heat baths.
