Gravity in Space
Gravity in space is the attraction between all masses that holds planets in orbit, shapes stars and galaxies, and never fully disappears with distance.
Definition
Gravity is the pull that every object has on every other object, and it is what keeps the Moon going around Earth and Earth going around the Sun. Its strength grows with the masses involved and shrinks with the square of the distance between them, so doubling the distance cuts the force to one quarter, and it never drops to zero no matter how far away you go. In space, gravity forms stars and planets from gas clouds, keeps planets and moons in orbit, and holds galaxies together. Newton's law of universal gravitation gives the force between masses $m_1$ and $m_2$ separated by $r$ as $F = G\,m_1 m_2 / r^2$, with $G = 6.674 \times 10^{-11}\ \text{N m}^2/\text{kg}^2$, which explains orbits, tides through the difference in pull across a body, the spherical shape of large bodies, and the collapse of gas clouds into stars. General relativity reinterprets gravity as the curvature of spacetime by mass and energy, a description that becomes necessary near black holes, for precise GPS timing, and for the expansion of the universe.
Example
You weigh about $6$ times less on the Moon than on Earth because the Moon is much smaller and pulls with less force, so a $60$-kilogram person would feel like $10$ kilograms there. Earth's surface gravity is $9.8\ \text{m/s}^2$, Mars's is $3.7\ \text{m/s}^2$, and the Moon's is $1.6\ \text{m/s}^2$, while Jupiter's is $24.8\ \text{m/s}^2$, so a person who weighs $500\ \text{N}$ on Earth would weigh over $1{,}200\ \text{N}$ on Jupiter. For the Earth-Sun system, $F = G M_{\odot} M_{\oplus} / r^2 \approx 3.5 \times 10^{22}\ \text{N}$, and setting that equal to $M_{\oplus} v^2 / r$ yields Earth's orbital speed $v \approx 30\ \text{km/s}$, matching observation.
Key Insight
Astronauts float on the space station not because there is no gravity up there, but because they and the station are falling around Earth together; gravity at that height is still about $90\%$ as strong as on the ground. Mass and weight are different: your mass is the same everywhere, while your weight is the force of gravity on that mass and changes from world to world. Gravity is by far the weakest of the fundamental forces, about $10^{36}$ times weaker than the electric force between two protons. It dominates the cosmos only because it is always attractive and has infinite range, so it adds up over astronomical masses while electric charges cancel out.