Could a gas be in thermodynamical equilibrium even with a gravitational field? Let us consider a cylinder filled with ideal gas, and let us assume that the gravitational field is parallel to one of its sides, well in this case, how would the system be in equilibrium?
Suppose that in fact the system is in equilibrium with temperature $T$, pressure $P$ and volume $V$. Knowing that the pressure is related to the density of the gas and its average kinect energy, we would expect a pressure greather in the bottom than in the top, how could the system be in equilibrium then?
 A: Previous answers are correct but incomplete, in that I suppose you do not much about Statistical Mechanics so maybe it's better to elaborate a little.
On a historical note, this is the same question that led Einstein to formulate is theory of Brownian motion and the same system I will describe now has been used by Perrin to measure Avogadro's number with a Nobel-winning experiment.
I will try to derive everything from simple formulas to make the answer clear.
EDIT: the author mentions the gas having constant PVT at equilibrium, whereas I Will assume that we are dealing with a system of N particles confined in a volume V and in contact with a thermostat (or with the environment) so that the temperature is always T. This situation I think better describes the everyday situation (e.g. sedimentation of colloids at room temperature) and it is easier to handle. The concepts about equilibrium in the answer are General and I Think the author did not choose those boundary conditions for a particular reason.
We start by defining our system: a cylinder of base $A$ and volume $V$ with inside $N$ molecules with mass $m$ at a temperature $T$. Gravity is acting parallel to the sides of the cylinder.
The gas is ideal so that $P(z) V(z) = N(z) k_B T$. Notice that while temperature is defined (as the mean kinetic energy is not affected by gravity), pressure and number of particles are a function of the height $z$ because gravity will pull molecules to the bottom and a gradient of density (and thus of pressure) will be formed as you suppose. Moreover $V(z)$ is the volume considered which contains $N(z)$ molecules. Think of it as a slice of the cylinder at height $z$.
Why doesn't everything sediment to the bottom and why are we still talking about equilibrium?
Molecules are still able to randomly move due to thermal fluctuations i.e. to diffuse. Yet as gravity pulls them to the bottom, a situation is created in which, since in the bottom there are more molecules than at the top, the probability of a molecule jumping "up" is higher than one jumping "down", so that as molecules sediment to the bottom they also manage to "jump up" a little. The more molecules at a given height, the more the probability of "jumping up" (the same holds for "jumping down", but at the top there are less molecules).
Equilibrium means that the two fluxes (one up due to diffusion and one down due to sedimentation) compensate so that there is no net flux of particles. The final (equilibrium distribution $N(z)$ (see image) is the one for which, at any $z$ the probability of jumping up/down are perfectly compensated.
$N(z)$" />
Can we find this distribution?
Yes, in two ways. Notice that from now on we will call $\rho(z)=N(z)/V$.
1)The thermodynamic (easy) way
We now that $P(z)V(z)=N(z)k_B T$. This means $\rho(z) = N(z)/V(z)=P(z)/k_BT$.
Now, what is the pressure inside a cylinder slice (of base $A$ and height $h$) at a given height $z$ from the bottom of the cylinder? It is given by the pressure "above" it $P(z+h)$, plus the weight of the slice (the number of particles $N(z)=\rho(z)V(z)$ inside the slice times $mg$) divided by the cylinder area $A$, so that
$$P(z)=P(z+h)+{\rho(z)V(z) mg \over A}$$
Using $V(z)=Ah$ and $\rho(z)=P(z)/k_BT$:
$$P(z)=P(z+h)+{P(z) mgh\over k_BT}$$
by dividing by $h$ and taking the limit $h\rightarrow 0$ we get a differential equation
$${dP(z)\over dz}=-P(z){mg\over k_B T}$$
which is easily solved as:
$$P(z)=P(0)e^{-mgz\over k_B T}$$
So we got the pression gradient. As we are in equilibrium, pressure is perfectly defined (despite being different) at any height. We only used the fact that there exists a state of the system in which the number of particles at a given height does not change over time (i. e. equilibrium or steady state - notice that this two concepts are actually slightly different but this is not relevant here).
What is the distribution of particles? Again using $\rho(z)=P(z)/k_BT$ we get
$$\rho(z)={P(0)\over k_B T}e^{-mgz\over k_B T}=\rho(0)e^{-mgz\over k_B T}$$
which as mentioned before is Boltzmann's distribution in the case of gravity.
Finally notice also that this section is equivalent to putting, as suggested by Chester Miller, the total force at any height to be vanishing as $A\left(P(z+h)-P(z)\right)+N(z)mg=0$, where $N(z)mg$ is weight and $A\left(P(z+h)-P(z)\right)$ the difference in force on the two sides of the cylinder, would give the same result. Notice also that if $g=0$ (no gravity) you find the normal result of constant pressure.
2)The statistical (hard) way
Just assume this the following formulas if you do not know them. They are quite easy to find anyway (look for mobility, diffusion current and drift current).
Gravity creates a flux of particles $J_g=\rho(z) \mu m g$ where $\mu$ is the particle mobility so that $\mu m g$ is the velocity due to the gravitational field. The flux due to particles moving randomly (diffusion) is given by $J_d=-\mu k_B T{d\rho(z)\over dz}$. By balancing fluxes so that $J_g=J_d$:
$$\rho(z) \mu m g=-\mu k_B T{d\rho(z)\over dz}$$
and again we find
$${d\rho(z)\over dz} = -\rho(z){mg\over k_B T}$$
which is the same equation as before with solution
$$\rho(z)=\rho(0)e^{-mgz\over k_B T}$$
Note that you can use both procedures with any external field, changing the force!
Both ways show that, even though there is a gradient of pressure, not only equilibrium exists (no fluxes of molecules and force balance) but that we can exploit it to find relevat results as $\rho(z)$ and $P(z)$ using what we know about equilibrium, e.g. $PV=Nk_B T$.
P.s. Take a look at Perrin's book about how He exploited this results to win a Nobel prize!
A: Thermodynamic equilibrium means that there are no internal or external net mass or energy currents in the system, not that there cannot be any pressure or density gradients. The equilibrium distribution of the molecule density n (and thus pressure p) of the gas follows the Boltzmann energy distribution, with the potential energy $E_{pot}=mgh$ $$n(h)=n(h=0)\exp{(-mgh/kT)}$$ where h is the height in the cylinder, m is the molecule mass, g is the gravitational acceleration, k is the Boltzmann constant, and T is the absolute temperature. Thus, in equilibrium at temperature $T$, the particle density $n$ and pressure $p=nkT$ are indeed highest at the bottom and decrease with height h.
A: It would be in equilibrium locally at each elevation.  For an ideal gas, the local pressure would be determined by the local specific volume (or density) and the temperature.  Not only would each parcel of gas be in thermodynamic equilibrium at each elevation, it would also be in static (force) equilibrium.$$\frac{dp}{dz}=-\rho g=-\frac{pMg}{RT}$$where M is the molecular weight.
A: For constant gravitational fields, with potential energy  $U$ proportional  to altitude, equilibrium is possible, see other responses. 
However, gravitational fields far from actual bodies, like earth are always vanishingly small as you go further from earth. ( $ U \propto  1/r$).
In this case gravitational equilibrium is not possible, and the atmosphere is escaping into space. 
You can look up Landau, Lev Davidovich, and E. M. Lifshitz. "Statistical physics, part I." (1980). The section you are looking for is section 38, p 114 in my edition Pergamon 3$^{\textrm{rd}}$ edition.
P.S. If someone knows how the escape time varies with planetary mass, i welcome an answer, I have been looking for this for a long time.
