The question is in the title. A more precise formulation is:
Let $X$ be a topological space. When does $H^i(X,F) = 0$ for all $i > 0$ and all abelian sheaves $F$ on $X$?
The obvious example is a discrete space. I'd be happy with a characterization of compact Hausdorff topological spaces $X$ satisfying the above property.