Since the Earth's formation approximately 4.5 billion years ago, the sun has risen and set on Earth approximately 4.5 billion times. This estimation assumes that Earth's rotation period has remained relatively constant over such a long span of time. It's important to note that Earth's rotation has gradually slowed down over billions of years due to tidal forces, but the effect is relatively small on such a large timescale.