The New Moon occurs when the sun and moon are on the same side of the earth. On this day, if you could somehow see the moon (which one obviously can't in reality) you would see the moon being up in the sky for roughly the entire duration from sunrise and sunset.
During Full Moon, both are on opposite sides of earth. So the moon rises roughly when the sun sets and vice-versa, hence no time when you can see both together.
Now consider the first quarter from this image:

As is apparent, on the day of first quarter, sun and moon are at 90$^\circ$ to each other. Imagine it is noon, you are directly facing the sun. If you look to one side, you see the half moon just rising above the eastern horizon. Now imagine it is sunset. The sun would just be sinking on the western horizon. You would directly face the first quarter moon. So the sun and moon had a common time from noon till sunset, roughly six hours. This common time changes based on the relative positions of sun and moon i.e. the phase of moon.
As the moon progresses from New to Full, the common time gradually reduces from the full sunrise-to-sunset (12 hours) till 0 at Full Moon, and reverse in the latter half of the cycle. Since the change is smooth, passing through each phase at equal gaps of time (thanks to the Moon's near circular orbit), the average is given by the mid-value between 0 and 12, that is 6 hours or 25% of the day. It only means that over a full lunar cycle, there is an equal chance of seeing both sun and moon for 8 hours (6+2) and 4 hours (6-2).
This is only a rough estimate; in reality the New Moon is hardly visible, the Moon's orbit is slightly tilted and elliptical, and the Moon revolves even through the course of the day, so the number will slightly change.