It doesn't, actually. Not exactly. The question specifically said "in the air", so there must be air resistance, and in the presence of air resistance the object will slow down and therefore take just slightly longer on the downward path than it did on the upward path. This difference isn't important for tossing an apple in a classroom demonstration, but it's absolutely vital when targeting artillery shells or ballistic missiles.
An object does spend exactly half the time rising and half the time falling "in a vacuum." Then there would not be air resistance, and there would only be a single force acting on the object, namely gravity.
Near the Earth's surface, gravity is approximately constant at 9.8 m/s^2, so the object experiences downward acceleration of 9.8 m/s^2 both while traveling upward and while traveling downward. Upward, this acceleration is against its velocity and slows it down. Downward, the acceleration is with its velocity, and it speeds up. The symmetry of the situation is such that there is just as much acceleration to do in each direction, and it takes the same amount of time.
More mathematically, this is the object's equation of motion:
` y = v_0 t - 1/2 g t^2 `
This is its velocity:
` v = v_0 - g t `
The top of the motion is when ` v = 0 ` , i.e. ` v_0 = g t `. The time this part takes is ` t = v_0 / g `.
If we solve the equation of motion for when y = 0, these are the times at which the object is at its starting height.
` y = (v_0 - g t/2) t = 0 `
` t = 0 or v_0 = g t / 2 `
` t = 0 or t = 2 v_0/g `
The `t = 0` solution corresponds to the start when it was first thrown. The `t = 2 v_0/g` solution corresponds to when it comes back. The trip upward is from` t = 0 ` to` t = v_0 /g` , while the trip downward is from` t = v_0/ g` to` t = 2 v_0/g` . Both trips take exactly `v_0/g.`