RR fields in Type II string theory are background fields described by differential forms. The (locally defined) potentials, say C, are not uniquely defined. One can always shift by a gauge transformation, that is, by an exact form. C ~ C+dB.
The field strength of these potentials (that is, the curvature,dC, of the local potentials) can be patched together into a globally defined, closed differential form, F. One can ask if you can patch together the potentials into a globally defined differential form as well. If you can, then F = dC globally, and so F is an exact form, and is therefore a representative of the trivial de Rham cohomology class.
Generally speaking, you can't patch together the potentials nicely, and so F is a closed form which is not (globally) exact. It represents a non-trivial class in the de Rham cohomology.
If this field has an (electric) source, then it satisfies
dF &= 0 \\
d \star F &= j
where j is the current of the C field, and the star is the hodge star. The current j is Poincare dual to a compact oriented submanifold, which has the natural interpretation of the worldvolume of an object which acts as the source of C. The homology class of this submanifold (or equivalently, the counterpart of this homology class in de Rham COhomology) is identified with the charge of the extended object.
It follows that the RR charge associated to an object depends on the topology of the object via the cohomology/homology.
(Note, it has been argued that cohomology is not an adequate description of RR charge, since it doesn't take into account the fact that a D-brane and an anti D-brane may annihilate to the vacuum. A more appropriate description is given by the K-theory, or in the presence of a non-trivial Neveu Schwarz background field, the twisted K-theory).