This paper presents the measurement of the relative width difference $\Delta \Gamma_d / \Gamma_d$ of the $B^0$-$\bar B^0$ system using the data collected by the ATLAS experiment at the LHC in $p p$ collisions at $\sqrt{s} = 7$ TeV and $\sqrt{s} = 8$ TeV and corresponding to an integrated luminosity of 25.2 fb$^{-1}$. The value of $\Delta \Gamma_d / \Gamma_d$ is obtained by comparing the decay-time distributions of $B^0 \to J/\psi K_S$ and $B^0 \to J/\psi K^{*0}(892)$ decays. The result is $\Delta \Gamma_d / \Gamma_d = (-0.1 \pm 1.1~\mbox{(stat.)} \pm 0.9~\mbox{(syst.)}) \times 10^{-2}$. Currently, this is the most precise single measurement of $\Delta \Gamma_d / \Gamma_d$. It agrees with the Standard Model prediction and the measurements by other experiments.