Gravity is the attraction between two objects, so it is found wherever objects exist, including in space.
The sun and other stars, the planets, and objects in distant galaxies all have gravity. Even space dust has it. Scientists are always finding out more about these gravitational connections.