J2 is one coefficient in a standard type of model of gravitational potential of a planet called a geopotential model. The coefficients are called gravitational moments, and indicate gravitational mass arranged other than that of a uniformly-dense sphere. J2 specifically reflects a planet's oblateness (flattening) due to rotation.
J2 is of interest for space flight navigation and is measured by observing the flight of spacecraft near a mass. Its measure aids in modeling the composition of a planet, thus measuring that of solar system planets is of interest. Cassini has been used for this with Saturn and Juno will be so-used with Jupiter.
All the solar system planets and the Sun are oblate from to rotation, and have a significant J2 coefficient. Jupiter and Saturn, with rotation periods of less than half an Earth-day, are the most oblate.
It is also useful in modeling the behavior of rings.
The J coefficients (J0 through infinity) are gravitational-potential spherical harmonics coefficients, specifically those that are symmetric around the planet's pole. These are generally the most significant coefficients for large rotating bodies (planets and stars), J2 being the most significant. They are termed gravity harmonics or gravitational harmonics, making up a gravity spectrum or gravitational spectrum of the body.
J3 is a similar coefficient but reflects asymmetry across the equator, thus is typically far less significant than J2. Further coefficients (J4, J5, J6, etc.) generally are symmetric across the equator if they are even-numbered.