Is there a notion (for schemes or just locally ringed spaces) of cohomology with compact support? I guess there is for algebraic schemes over $\mathbf{C}$, but what about schemes in general? Does anybody have a good reference?

Yes there is. Take $S$ a scheme and take $f \colon X \to S$ a compactifiable morphism of schemes. By definition this means that there exists a proper $S$scheme Y which contains $X$ as an open subscheme. Then, given a compactification and a sheaf on $X$, you may define the cohomology with proper support of this sheaf as the cohomology of the pushforward of your sheaf to $Y$. I think this works for many different cohomologies, but you need to check that the compact support cohomology does not depend on the chosen compactification. At least for etale sheaves I know this is so. 


SGA 2 is the original reference. You can find it here 


If X is a smooth scheme over complex numbers then you can consider $X_{an}$ as an complex analytic manifold and compute singular/ deRham/ simplicial cohomology with compact supports (this will be different from usual cohomology if X is not proper) On the Algebraic side there is etale cohomology with compact supports (which is defined by embedding X into a proper scheme...). Comparison theorems tell you that etale cohomology with torsion coefficients agree with singular cohomology (with torsion coeff). Any reference on etale cohomology will discuss this. Ref:SGA 4.5, Milne: Etale Cohomology. 

