We present the final results for the deuteron spin structure functions obtained from the full data set collected with Jefferson Labs CLAS in 2000-2001. Polarized electrons with energies of 1.6, 2.5, 4.2 and 5.8 GeV were scattered from deuteron ($^{15}$ND$_3$) targets, dynamically polarized along the beam direction, and detected with CLAS. From the measured double spin asymmetry, the virtual photon absorption asymmetry $A_1^d$ and the polarized structure function $g_1^d$ were extracted over a wide kinematic range (0.05 GeV$^2 < Q^2 <$ 5 GeV$^2$ and 0.9 GeV $< W <$ 3 GeV). We use an unfolding procedure and a parametrization of the corresponding proton results to extract from these data the polarized structure functions $A_1^n$ and $g_1^n$ of the (bound) neutron, which are so far unknown in the resonance region, $W < 2$ GeV. We compare our final results, including several moments of the deuteron and neutron spin structure functions, with various theoretical models and expectations as well as parametrizations of the world data. The unprecedented precision and dense kinematic coverage of these data can aid in future extractions of polarized parton distributions, tests of perturbative QCD predictions for the quark polarization at large $x$, a better understanding of quark-hadron duality, and more precise values for higher-twist matrix elements in the framework of the Operator Product Expansion.