The electron spin dynamics in spontaneously formed GaN nanowires (NWs) on Si(111) is investigated by time-resolved magneto-optical Kerr-rotation spectroscopy for temperatures from 15 to 260 K. A strong increase in the electron spin relaxation time by more than an order of magnitude is found as compared to bulk GaN. The temperature dependence of spin relaxation is characterized by two regimes, which are explained by a model taking into account the coexistence of two different mechanisms. As a result, the spin lifetime is limited by hyperfine interaction of localized electron spins with nuclear spins at low temperatures. The mesoscopic electron confinement in the NWs leads to a dominance of Dyakonov-Perel spin relaxation driven by interface-induced contributions at high temperatures, resulting in a slowdown , but not complete suppression of spin relaxation as compared to bulk GaN. These findings underline the important role of the high surface-tovolume ratio in NWs.