Both Newton and Einstein gave the theory on gravitaion. Both of them are correct with respect to their point of view. According to Newton te force of gravity is due to the mass of the object but according to einstein it is due to space time warp.
In physics, spacetime is any mathematical model that fuses the three dimensions of space and the one dimension of time into a single 4‑dimensional continuum. Spacetime diagrams are useful in visualizing and understanding relativistic effects such as how different observers perceive where and when events occur.
Gravity is actually due to the curved space time of the object. But the curve in space time is because of the mass of the object. When an object have mass in it then due to its mass the space time warp takes place and the region arround the object is attracted towards the object. Higher the mass higher is the curve of the space time and so heigher is the gravitational force of the object. And hence indirectly its the mass which is responsible for the curve in the space time cause the gravitional pull though the direct effect of gravity is the space time warp arround the object having mass. You will understand it better when you get into higher classes as because you are in class 9th so you will not be able to understand the complex equation of general theory of relativity so i am not including the equations along with it.