Sunlight disappears for roughly 12 hours every 24 hours because Earth rotates on its axis.
Earth takes about 24 hours to complete one rotation.
At any moment, half of Earth faces the Sun → daytime ☀️
The other half faces away from the Sun → nighttime 🌙
As Earth rotates, your location moves from the Sun-facing side to the dark side and back again.
So, approximately:
12 hours → day ☀️
12 hours → night 🌙
However, it isn't exactly 12/12 everywhere. Earth's 23.5° axial tilt and its orbit around the Sun cause day and night lengths to vary with latitude and season. Near the equator they stay close to 12 hours, while near the poles they can have extremely long days or nights.