Actually it's the other way around. With different centripetal forces, the paths the planets follow are different, in interesting ways. Rather than the orbits causing the centripetal force, it's the centripetal force that causes the orbits (according to Newton's theory anyway).
It stays in a fixed orbit because the centripetal force is just right to permit orbits. As you get closer to the sun it gets stronger but not too strong, as you go further away it gets weaker but not too weak.
It's an inverse square law, the force towards the sun reduces by four every time you double the distance from the sun.
An inverse cube law - goes down by 8 each time you double the distance - doesn't lead to orbits. Nor does a straightforward inverse law where the force halves each time you double the distance.
The special thing about the inverse square law is that a planet in a closed orbit after going around the sun returns to its starting point.
There is only one other law like that, Hooke's law, that the force increases linearly with the distance. Hooke's law is the force law you get in a string, which is why you can swing a ball around your head on an elastic string and it will follow a circular path, or more generally a closed path, as the force law is Hooke's, to first approximation anyway.
Newton's theorem of revolving orbits
You can try it out with this online app. It doesn't work in Chrome but works in Opera, Firefox and Internet Explorer. It will ask you to install the Unity web plugin if you haven't done this before.
go to Play Online! and click Create.
You get a system like this with inverse square.
Now pause it, go to load / save and load their Orbits example which has the same planets in the same starting positions as before.
Now go to Settings, third button from bottom.
Set the force law to say, r^-3, inverse cube and this is what you get.
All the inner planets quickly hit the sun, the one remaining goes to infinity.
To reset go to the load / save button and load the orbits example
Try r^-1 and hit the play button and you get this
The planets follow these clover pattern orbits that don't join up a bit like a spirograph. The innermost planet here follows a more or less circular orbit. But it doesn't join up.
If gravity worked like this, we could perhaps actually have habitable planets, but most would be in these clover like orbits.
Try Hooke's law like swinging a ball around on a perfectly elastic string and you get
This is the only other central force law (i.e. force is towards the sun and the force depends only on distance from the sun) with closed orbits.
Of course the planets also influence each other - these screen shots show the two body solution where you assume the central body is so heavy that the forces of the planets on each other is negligible, at least to a first approximation. Which is pretty much the case for our solar system. Planets do influence each other, but only on quite long timescales and not in dramatic ways in the present solar system which is pretty much in a stable configuration.
I couldn't enter text to save these examples online - perhaps incompatibility issue of some sort with Internet Explorer but it's easy to set them up yourself following these instructions hopefully.
The app is here: Gravity Simulator
This is all classical newtonian theory. You look at things a bit differently in General Relativity but I'm not expert on that. In General Relativity then the Earth follows its orbit because space time around the sun is curved - it's following the longest path through space-time (lots of people incorrectly say that in GR planets follow the shortest path - yes it's a geodesic but it's an unusual kind of geodesic following the longst rather than the shortest path in the space time metric of General Relativity). It takes as long as it can to get around the sun.
But others would be better explaining that.