You may consider reading Wikipedia's article on sunrise equations. The lead paragraph gives the equation:

where:
- ωo is the hour angle in degrees at either sunrise (when negative value is taken) or sunset (when positive value is taken) in degree (°)
- φ is the latitude of the observer on the Earth in degrees
- δ is the sun declination in degrees