How can tides form?
Gravitational pull of moon and sun on the Earth oceans and Earth rotation.
The gravitational pull of the moon and of the sun affects the oceans (and other large water bodies) of the Earth.
The water on the side of the planet closer to the Moon is attracted towards it generating a bulge; on the opposite side a similar bulge is created by the inertia of the water that tends to move away from the Earth due to the centrifugal force generated by the rotation of the planet.
In a theoretical homogeneous and continuous ocean two equal high tides and two equal low tides should follow each other within 24h.
This theoretical situation is modified by several factors:
The "lunar day" (that is the time required for any given point on the Earth surface to rotate from an exact position under the moon back to the same position) is of 24h and 50 minutes. This causes the cycle of high-tide / low-tide to be repeated every 12h and 25 minutes. It takes 6h and 12 minutes for the water along any given shore to go from high to low or from low to high.
The ocean is not continuous and its movements are affected by the surrounding land-masses thus causing changes in both timing and amplitude of the tides. Some areas experience two low and to high tides of similar amplitude each day following a "semidiurnal" cycle. When the tides differ in amplitude the cycle is called mixed. Finally other areas have one high and one low tide only each day and this cycle is called "diurnal"
The relative position of Moon and Sun affects the magnitude of the tides with the maximum high (or low) tide generated when the combined gravitational pull of the Moon and the Sun is the maximum (spring tides).
Specific topography of the shore can affect the magnitude of the tide. As example funnel-shaped bays may amplify the tide creating massive high and low tide. This is the case for the Bay of Fundy in Canada with tidal range up to 17 meters.
The combined effect of wind and tide can also enhance or reduce the magnitude of the tidal range.