Normal heart rhythm is called sinus rhythm. A sinus beat starts in the sinus node, at the top of the right atrium. The sinus node is a group of heart muscle cells that generate electrical impulses.
The conduction system of the heart
The impulses spread through the atria via the heart’s conduction system, which consists of specialised heart muscle cells. At the junction between the right atrium and the ventricles, the conduction system ends in the atrioventricular node (AV node). It acts as a filter and protects the ventricles from being overloaded if fast rhythms arise in the atria.

From the AV node there is usually only one route for the electrical impulses down to the ventricles. As soon as the impulses arrive there, they are distributed into a right and a left bundle branch. These divide further, so that the electrical signals reach all parts of the ventricles and make them contract.

When the rhythm deviates
Heartbeats that deviate from the description above are abnormal. This is very common and is called a heart rhythm disorder, cardiac arrhythmia or simply arrhythmia. Some are completely harmless, others need treatment.
Even normal sinus rhythm is not completely regular. The time between heartbeats varies constantly with breathing and with the control of the nervous system. Read more under What is heart rate variability?.