$$h=\frac{2\cdot\left|\cos^{-1}\left(-\tan l\left(-a\left(\cos\left(\frac{360d}{y}\right)\right)\right)\right)\right|}{15}*\frac{1}{15}$$

  [1]: https://i.sstatic.net/6w8A6.png

 - h = hours of daylight
 - l = latitude (in degrees)
 - a = axial tilt of the planet (in degrees)
 - d = number of days (local days, not Earth days) since the planet's spring solstice in its Northern Hemisphere
 - y = number of days (local days, not Earth days) in a year on the planet

This formula calculates the length of day in decimal hours (not including astronomical refraction (which causes twilight), solar disc diameter, or elevation of the observer) for planets (not including moons) with day lengths shorter than their year lengths that are not tidally locked. However, the influence of the above three factors is very minimal. 

Astronomical refraction cannot be calculated unless you know the exact atmospheric composition of the observer. Solar disc diameter requires knowledge of the diameter of the planet's star and the distance of the planet from the star. The length of day on moons is a lot more difficult to calculate because they require calculation of the moon's orbit around its planet. Tidally locked worlds have the same amount of daylight throughout the year except for a few seasonal changes caused by axial tilt. 

Note: This answer will give you the number of hours as a decimal. For example, 2 hours and 12 minutes will come out as 2.2. To convert this number into hours, minutes, and seconds; go here: https://unitconverter.net/decimal-to-time-calculator

This answer is adapted from the Sunrise equation<sup>1</sup> and the Declination equation<sup>2</sup>. 

1. https://en.wikipedia.org/wiki/Sunrise_equation
2. https://sciencing.com/calculate-suns-declination-6904335.html