This is because the gravitational force between two objects not only depends on the masses of both objects, but also on the distance between the objects. Now that you know that gravity depends on mass and distance, we can answer your question about how gravity affects acceleration. Newton's second law of motion states that force equals mass times acceleration. Let's say for example that you want to find the acceleration of objects on different planets. If you set up an equation and do some math, you will find that near the ground of the planets, the acceleration of objects depends on the mass of the planet and the radius of the planet.
Gravitational acceleration increases as planet mass increases and planet radius decreases.
There's a lot that can be said here, and there are lots of different situations that we can look at, but it's hard to do that without using a bunch of equations. If you want to find more information and the math behind it all, here is an excellent website that you should definitely look at.