Is the human biological clock genetically programmed or learnt?
Short answer
The biological master clock is neurologically and genetically hardwired. The biological clock is not affected by learning. Instead, it is constantly entrained mainly by daylight.  

Background
The biological clock is hardwired in the human body and can be traced back to the master clock in the suprachiasmatic nuclei (SCN) of the hypothalamus (Fig. 1). 


Fig. 1. The SCN is entrained by environmental light captured by the retina in the eyes. Source: Neuroscience News.

The SCN is an intrinsic oscillator that governs sleep and wake timing, rhythms of temperature, hormones, mood and cognitive acuity etc. etc. These rhythms are entrained to 24 hours by the environmental light-dark cycle primarily via a subset of photosensitive retinal ganglion cells that project directly to the SCN (Fig. 1). Using hormones and neuronal signals, the SCN entrains peripheral clocks of similar molecular mechanism present in many tissues (Pagani et al., 2010). 

In humans and other organisms, the timing of 24-hour behavior is governed by the period length of the circadian oscillator. This period is approximately, but not exactly, 24 hours long (circa diem), and ranges from 23.47–24.64 across people (23 hours 28 min to 24 hours 38 minutes) in laboratory conditions (Pagani et al., 2010).

Why is it circa diem and not exactly 24 hours? Note that the absolute length of a day depends on the definition used. For example, one complete rotation of the earth around its axis (the sidereal day) actually takes 23 hours, 56 minutes and 4.1 seconds. The solar day is 24 hours and is defined by the time it takes the sun to make an apparent circuit across the skies. More importantly, there is apparent solar time, sometimes called true solar time, which is determined by the daily apparent motion of the observed sun. It is based on the interval between two successive returns of the sun to the local meridian. The length of a solar day varies throughout the year, and the accumulated effect of these variations (equation of time) produces seasonal deviations of up to 16 minutes.

The length of a day can also be defined in the number or hours from sunrise to sunset, which varies where you are on earth. At the equator every day of the year is exactly 12 hours long. At 50° latitude (e.g., England &amp; Canada) the longest day is 16.5 hours and the shortest day 7.5 hours. At 35° latitude (e.g. many US states and Greece) the longest day is 14.5 hours and the shortest day 9.5 hours. Given that light is the most effective way to entrain the circadian rhythm, it is obvious why the absolute length of the intrinsic circadian rhythm is not important. As long as it is circa diem, it will do.   

Reference
- Pagani et al., PloSONE (2010); 5(10): e13376