We study the empirical relation between an astronomical objects angular momentum $J$ and mass $M$, $J=beta M^alpha$, the $J-M$ relation, using N-body simulations. In particular, we investigate the time evolution of the $J-M$ relation to study how the initial power spectrum and cosmological model affect this relation, and to test two popular models of its origin - mechanical equilibrium and tidal torque theory. We find that in the $Lambda$CDM model, $alpha$ starts with a value of $sim 1.5$ at high redshift $z$, increases monotonically, and finally reaches $5/3$ near $z=0$, whereas $beta$ evolves linearly with time in the beginning, reaches a maximum and decreases, and stabilizes finally. A three-regime scheme is proposed to understand this newly observed picture. We show that the tidal torque theory accounts for this time evolution behaviour in the linear regime, whereas $alpha=5/3$ comes from the virial equilibrium of haloes. The $J-M$ relation in the linear regime contains the information of the power spectrum and cosmological model. The $J-M$ relations for haloes in different environments and with different merging histories are also investigated to study the effects of a halos non-linear evolution. An updated and more complete understanding of the $J-M$ relation is thus obtained.