A question was marked as a duplicate of a duplicate of this question, so I am posting my answer here.
Gravity is due to the curvature of spacetime
I believe it is true. That is what general relativity says, and general relativity has been confirmed in predictions ranging from the existence of black holes to the orbit of Mercury to the bending of light.
Relation between spacetime, curvature, mass and gravity
You say you are confused about how the curvature of spacetime and gravity are related. I am going to explain mainly that in my answer, starting with simpler examples, and moving to more complicated ones.
Okay, let's say you have a sheet of rubber. This is the classic example of spacetime. Let's say you take a bowling ball, and set it on the taut sheet of rubber. It has a large mass (compared to what else we'll be putting on the sheet), therefore the sheet curves a lot for the bowling ball. We now have an image in our head like the one below:
So mass leads to curvature. Then, take a baseball, say, and set it near the bowling ball. It rolls toward the bowling ball, right? This occurs because of the curvature of the sheet. So, then, curvature leads to gravity. So, if an object has large mass, it will curve spacetime dramatically, leading to strong gravity.
This is, of course, an overly simplistic example. It is 2-d, and it doesn't take into account other factors. Let us move to 3-d (keeping in mind the universe is accepted to be at 4-d, ignoring the holographic principle). The mass of a bowling ball now sucks in space around it, sort of like in the picture below:
And now, in this case, we can see (or understand) that more mass still leads to more curvature. The greater the mass, the more spacetime will "contract" around the object. So we still think that mass leads to curvature. Now, if we set an object near this massive object (like the moon next to Earth) it is "sucked in" sort of, by the curvature of spacetime, though of course the moon contracts spacetime around it as well. At this point, we can reasonably still conclude that in 3-d, mass leads to curvature which leads to gravity.
But, as I said earlier, the universe is generally thought of as 4-d. What does our picture look like when we add time? Well, the time dimension is contracted around a massive object. So let us picture our previous example but that the fabric of spacetime has a few clocks embedded in it occasionally. As the space stretches and contracts, so will the clocks (the "time") and so the time on those clocks will be "wrong" - it'll differ from the other clocks. And in this case, as the Earth contracts space and time around it, it changes the time and space (it curves spacetime) and so when another object enters our region of spacetime, it is "sucked in" still, but so is it's time. This is, of course, a very extreme example, but I hope this shows that we can conclude that mass leads to curvature which leads to gravity. And a black hole, is simply so much mass that it leads to so much curvature that the gravity is so strong that light cannot escape.
I hope this helps!