Als ich neun war.
You could also say:
Mit neun Jahren. (At the age of nine) This is slightly more formal.