In simple words The planets are formed from some spinning disk-shaped cloud, and continued this rotating course around the Sun after they were formed. The gravity of the Sun keeps the planets in their orbits. They stay in their orbits because there is no other force in the Solar System which can stop them.
Gravity of sun influences planet to move.