* Vertical Motion: The time a projectile spends in the air is determined by its vertical motion. Both balls have the same initial vertical velocity (0 in the case of the horizontally thrown ball), and they are both subject to the same acceleration due to gravity.
* Horizontal Motion: The horizontal motion of the balls doesn't affect how long they stay in the air. The horizontally thrown ball will travel further horizontally, but its vertical motion (and therefore its time in the air) is governed by gravity alone.
In short: Both balls take the same amount of time to go up and then come back down because they have the same vertical motion. The horizontally thrown ball just travels further in that time due to its horizontal velocity.