Assuming a spherical Earth of uniform density, the answer is: about 21 minutes and 5 seconds.
Due to the mathematics of the inverse square law (with a spherical distribution of mass) the centripetal attraction at a distance z from the center is exactly the attraction which would be caused with all the mass located at a LESSER DISTANCE from the center if it was concentrated at the center. (Curiously enough, there's a zero net gravitation from a uniform sperical hollow shell if you're inside it.)
The attraction is thus proportional to the cube of z (that's what the total mass of the inner sphere is like) divided by the square of z (the inverse square law of gravitation). All told, it's simply proportional to z.
A motion in which the acceleration is proportional to the displacement is called an "harmonic" motion. This is exactly what we have here: The amplitude (z) is a sine function of time and the period of such a motion is like the period of a pendulum; it does NOT depend on the maximum amplitude (if you drop the ball from the halfway point to the center, it will also take 21 minutes and 5 seconds to reach the center; as it just travel shorter distances more slowly).
Curiously, the result remains the same for any straight frictionless vacuum tunnel which does NOT go through the center of the Earth. This is to say that such a tunnel allows gravity to carry a ball from one point of the Earth to any other in just 42 minutes and 10 seconds, starting at sero speed and arriving at zero speed).
Nice piece of "fantasy engineering". See link:


