We'll start with a mathematical representation of the vertical balance of forces and then construct the equation from the following two statements:
Recall that the vertical pressure gradient force is a result of air pressure, which pushes in all directions. A vertical pressure gradient represents a situation in which the pressure decreases with height, so that the air pressure pushing upward on the bottom of a parcel of air is larger than the air pressure pushing downward on the top of the parcel of air. The force per unit volume is just the rate of change of pressure with height. Mathematically, that is written as dp/dz, where p is pressure, z is height, and the entire expression represents the change in pressure over a tiny vertical distance divided by the length of that distance.
The gravitational force is usually expressed mathematically in a very simple way, by writing it as the mass of the object times the acceleration gravity causes. This acceleration is a constant, equal to 9.8 m/s2. (Sooner or later, you'll need to memorize this number). To compare to pressure, we need the force per unit volume: m g / V or ρg, where m is the mass of a volume of air, g is the gravitational acceleration, V is the size of the volume, and ρ, which is m / V, is the density of air.
So the mathematical statement that gravity is balanced in the atmosphere by the vertical pressure gradient force is:
dp/dz = - ρg
The minus sign is there because the force of gravity is oriented downwards, in the negative z direction. This mathematical statement is called the "hydrostatic equation", and the balance of forces it represents is called "hydrostatic balance".