The Moon orbiting Earth
(taken from space) - NASA
Gravity attracts all objects towards each other. Gravity has been around since the very beginning of the universe, and it works the same way everywhere in the universe, on all kinds of different objects, of all different sizes (larger than atoms - those are held together by atomic forces instead). The bigger an object is, and the closer you are to it, the stronger its gravitational pull is.
In the very beginning of the universe, after the Big Bang, gravity pulled atoms together to make stars and planets. Once the stars and planets had formed, gravity kept the planets in orbit around the stars, and moons orbiting around the planets. And on each planet that is large enough, gravity keeps an atmosphere around the planet.
On Earth, gravity keeps the air around us (and everything else) from drifting off into space. Gravity also causes things to fall to the ground, and causes the ocean's tides, and causes hot air to rise while colder air falls (which in turn causes wind).
Nobody fully understands how gravity works, or even why gravity exists. One way of looking at gravity is to think of it not as a force like magnetism, but instead as a natural result of the way mass bends space. Any object with mass (like a star) pushes on space and bends it, so that other objects (like planets) that are moving in a straight line are also going around the star. It looks to us like the star is pulling on the planet, but really the star is bending space.
Another way of thinking about gravity is to think that the star and the planet are exchanging tiny particles called gravitons, that help to pull the star and the planet together. It's as if they were tossing tiny balls back and forth between them. But if the planet gets further away from the star, more of the balls get dropped and lost, and so the gravity between them is weaker. It's likely that both of these ideas are at least partly right - maybe the gravitons bend space, or maybe bending space produces gravitons.
Most of the time, when people need to figure out some problem involving gravity, like how fast a ball will fall when you drop it from a tall building, they forget about why it works and just use a good-enough approximation of what gravity does. This approximation tells us that gravity at the surface of the Earth is approximately 9.8 meters per second. That means that, not counting friction with the air, if you drop a ball from a building, it will go faster by 9.8 meters/second for every second that it falls. If it begins at 0 meters/second, after one second the ball will be going 9.8 meters/second, and after two seconds it will be going 19.6 meters/second, and after three seconds it will be going 29.4 meters/second, and so on.
Bibliography and further reading about gravity: