The force for a spring with displacement \vec{x}, spring constant k is \vec{F}(x)=-k\vec{x} (Hook's Law).
From Newton's law \vec{F}=m \vec{a}=m \frac{d^2 x}{dt^2}
So math_failure (math_image_error): m \frac{d^2x}{dt^2}=-k x .
The solution of the above equation is x=A \sin\omega t.
Since \frac{dx}{dt}= A \omega \cos\omega t, \frac{d^2x}{dt^2}= -A \omega^2 \sin\omega t=-\omega^2 x
So \omega=\sqrt{\frac{k}{m}}.
If the spring is moved away equilibrium position, it will move with displacement similar to x=A \sin\omega t, which is called simple Harmonic motion (SHM).

The following applet shows relation betweeb simple harmonic motion and spring motion.


\frac{x^2}{a^2}+\frac{y^2}{b^2}=1, x(t)=a*\sin(\omega t), y(t)=b*\cos(\omega t)





http://www.youtube.com/watch?v=SZ541Luq4nE

The above clip is actually adopted from "The mechanical universe" series.

http://www.youtube.com/watch?v=cD2KdK2GSvw