Moon
The moon has the greatest constant effect on the tides on a daily basis as its relative position to the Earth determines the height of the tides. When the moon orbits close to the Earth, its gravitational forces increase by nearly 50 percent, which causes higher tides. When the orbit is further away the tides are lower. This results in a lunar cycle for tides every month, as it takes a month for the moon to go from full moon to new moon and back to full.
Sun
The Earth does one full orbit around the sun every year and the relative gravitational pull from the sun causes yearly cycles in tides. The relative position of the Earth's axis to the sun means you can get higher tides during the spring and summer months.
Earth's Rotation
The relative position of the Earth to both lunar and solar bodies results in predictable high and low tides dependent on where on the globe you are. A popular way of explaining this is to imagine the oceans as elliptical and separate from the continents. This results in two bulges of water on opposite sides of the Earth. As the Earth rotates on its axis once a day, this results in two high tides and two low tides.
Range Variation
At certain times of the year, parts of the Earth experience higher tides than normal, conversely meaning other parts get lower tides than normal. This is due to a combination of the positioning of the Earth, moon and sun. A spring tide, or abnormally high tide, occurs when all three are lined up, causing more gravitational pull on the Earth's oceans. Neap tides, or lower than normal tides, occur when the bodies are out of line.