  The versatile potential of lead halide perovskites and two-dimensional
materials is merged in the Ruddlesen-Popper perovskites having outstanding
optical properties. Here, the coherent spin dynamics in Ruddlesen-Popper
(PEA)$_2$PbI$_4$ perovskites are investigated by picosecond pump-probe Kerr
rotation in an external magnetic field. The Larmor spin precession of resident
electrons with a spin dephasing time of 190~ps is identified. The longitudinal
spin relaxation time in weak magnetic fields measured by the spin inertia
method is as long as 25~$\mu$s. A significant anisotropy of the electron
$g$-factor with the in-plane value of $+2.45$ and out-of-plane value of $+2.05$
is found. The exciton out-of-plane $g$-factor is measured to be of $+1.6$ by
magneto-reflectivity. This work contributes to the understanding of the
spin-dependent properties of two-dimensional perovskites and their spin
dynamics.
