Luboš's answer is of course perfectly correct. I'll try to give you some examples why the straightest line is physically motivated (besides being mathematically exceptional as an extremal curve).
Image a 2-sphere (a surface of a ball). If an ant lives there and he just walks straight, it should be obvious that he'll come back where he came from with his trajectory being a circle. Imagine a second ant and suppose he'll start to walk from the same point as the first ant and at the same speed but into a different direction. He'll also produce circle and the two circles will cross at two points (you can imagine those circles as meridians and the crossing points as a north resp. south poles).
Now, from the ants' perspective who aren't aware that they are living in a curved space, this will seem that there is a force between them because their distance will be changing in time non-linearly (think about those meridians again). This is one of the effects of the curved space-time on movement on the particles (these are actually tidal forces). You might imagine that if the surface wasn't a sphere but instead was curved differently, the straight lines would also look different. E.g. for a trampoline you'll get ellipses (well, almost, they do not close completely, leading e.g. to the precession of the perihelion of the Mercury).
So much for the explanation of how curved space-time (discussion above was just about space; if you introduce special relativity into the picture, you'll get also new effects of mixing of space and time as usual). But how does the space-time know it should be curved in the first place? Well, it's because it obeys Einstein's equations (why does it obey these equations is a separate question though). These equations describe precisely how matter affects space-time. They are of course compatible with Newtonian gravity in low-velocity, small-mass regime, so e.g. for a Sun you'll obtain that trampoline curvature and the planets (which will also produce little dents, catching moons, for example; but forget about those for a moment because they are not that important for the movement of the planet around the Sun) will follow straight lines, moving in ellipses (again, almost ellipses).
As long as you add the mass in a way that does not affect its speed, then the orbit is not changed(your star must be fixed as well).
Lets say the planet(mass $M$) is orbiting at a radius $R$, about a star of mass $M_\star$. The orbital velocity is $$v_1=\sqrt{\frac{GM_\star}{R}}$$. Now, in the comments you stated that you added the mass in a way that does not affect its velocity directly. Simce momentum is conserved, the only way to do this is to give the added mass $m$ a velocity $v_1$ as well at the time it reaches the planet. As you can see, when the planet captures the mass, there is no change in angular momentum ($mv_1R+Mv_1R=(m+M)v_1R$). Now, since theres no change in angular momentum, it will orbit at the same angular velocity. If its the same angular velocity, the radius is the same as well. So it stays in stable orbit. One can get this directly from $v_1=\sqrt{\frac{GM_\star}{R}}$ as well.
What if the mass was at rest and it was captured? Well, then by conservation of linear momentum, the velocity would decrease to $v_2$. Since the velocity decreased, it will go into an elliptical orbit. If the velocity had increased, the orbit could be elliptical, but it can be hyperbolic (greater than escape velocity) and leave the system as well. This depends upon the mass ratio.
If the central mass was not fixed, then the masses orbit around the center of mass(barycenter), and the orbital angular velocity is given by$\omega=\sqrt{\frac{G\mu}{R^3}}$ (note that I'm using angular velocity in this case, as the star and planet will have different velocities). $R$ is the distance between the objects, and $\mu=\frac{MM_\star}{M+M_\star}$ is the reduced mass. One can see that a whole variety of things can happen, depending on how you add the small mass, and on the ratio between the three masses. You may want to analyse this yourself (seeing as it's not part of the question and it's a pretty interesting exercise)
Best Answer
Simple answer: gravity is a centripetal force, and can be envisaged clearly as such in Newtonian mechanics.
Centripetal just means a force that is "radially inwards" ("directed towards the centre"). The electric force between two objects of opposite charges, for example, is also clearly centripetal. (It's slightly harder to define "centripetal" for the magnetic force.)
Your astronomy teacher is referring to Einstein's theory of general relativity. His description is loosely an overview of the topology (fabric) of space-time and how it interacts with matter/energy - the manifold is however 4-dimensional, not 3D.
In fact, test particles (particles which do not really disturb the gravitational field) in general relativity follow a geodesic. This is effectively a generalisation of a straight line (shortest route) of normal Euclidian space to the curved space of GR, and may be seen as the source of centripetal force in Newtonian physics.