Gravity has an effect on a projectile because it reduces the height that it can achieve.
The object's upward movement is stopped by gravity, which pulls it back to earth, limiting the projectile's vertical component. As a projectile moves through the air it is slowed down by air resistance.