Tides are the result of the gravitational attraction of the sun and the moon on the earth.
The attraction of the moon is far greater than the attraction of the sun due to the close proximity of the earth and the moon. The sun is 360 times further from the earth than the moon. Therefore, the moon plays a larger role than the sun in producing tides. Every 27.3 days, the earth and the moon revolve around a common point. This means that the oceans and other water bodies which are affected by the earth-moon system experience a new tidal cycle every 27.3 days.