Sheaves and complex analysis
As a complement to Matt's very interesting answer, let me add a few words on the historical context of Leray's discoveries.
Leray was an officer in the French army and after Frances's defeat in 1940, he was sent to Oflag XVII in Edelsbach, Austria (Oflag=Offizierslager=POW camp): look here .
The prisoners founded a university in captivity, of which Leray was the recteur (dean).
Leray was a brilliant specialist in fluid dynamics (he joked that he was un mécanicien, a mechanic!), but he feared that if the Germans learned that he gave a course on that subject, they would force him to work for them and help them in their war machine (planes, submarines,...).
So he decided to teach a harmless subject: algebraic topology!
So doing he recreated the basics on a subject in which he was a neophyte and invented sheaves, sheaf cohomology and spectral sequences.
After the war his work was examined, clarified and amplified by Henri Cartan (who introduced the definition of sheaves in terms of étalé spaces) and his student Koszul.
Serre (another Cartan student) and Cartan then dazzled the world with the overwhelming power of these new tools applied to algebraic topology, complex analysis in several variables and algebraic geometry.
I find it quite interesting and moving that the patriotism of one courageous man (officers had the option to be freed if they agreed to work for the Nazis) changed the course of 20th century mathematics.
Here, finally, is Haynes Miller's fascinating article on Leray's contributions.
Sheaf theory was introduced into complex analysis very soon after it was invented by Leray (unfortunately, I don't really know about Leray's own motivations and intentions for the theory), by Cartan, but in the context of several complex variables, not just one.
What he did was reformulate Oka's theorems in sheaf-theoretic language, by proving that the structure sheaf $\mathcal O$ on $\mathbb C^n$ is coherent. He also proved his famous Theorems A and B about the coherent sheaves on Stein spaces (which e.g. immediately recover the Mittag-Leffler result discussed in Georges's answer).
Roughly speaking, the reason that sheaf theory is useful in complex analysis is that one doesn't have the patching technique of partitions of unity that is available in smooth function theory.
Indeed, one can use partitions of unity to show that the higher cohomology of the sheaf of smooth functions (and of related sheaves, such as sheaves of smooth sections of vector bundles) on any smooth manifold vanishes; this more-or-less guarantees that sheaf theory won't be a very useful tool in that setting.
But in complex analysis, those techniques aren't available, and indeed in general on complex manifolds higher cohomology of the structure sheaf, and related sheaves, needn't vanish. Thus sheaf theory becomes a useful tool. Indeed, one knows from results such as the classical Mittag-Leffler theorem that local-to-global patching of a certain kind is sometimes possible in complex analysis; sheaf theory (and especially sheaf cohomology) becomes a way to measure the obstructions to such patching, and of organizing information about those obstructions (e.g. so that one can show that they vanish in certain circumstances).
You shouldn't think that sheaf theory provides a replacement for analytic arguments; rather, it supplies a framework for efficiently organizing that analytic input, and making useful deductions from it in a conceptually clear fashion.
The Mittag-Leffler theorem says the following:
If $U\subset \mathbb C$ is open and if $D\subset U$ is a discrete closed subset, you can choose arbitrarily at every $d\in D$ a polar development $\sum_{k=1}^{n(d)} a_k(\frac {1}{z- d})^k$ and there will exist a meromorphic function $m\in \mathcal M(U)$ whose polar part at $d$ is the given one and holomorphic on $U\setminus D$.
In sheaf theoretic terms this follows from the vanishing of the first cohomology group of the sheaf of holomorphic functions on the open set: $H^1(U,\mathcal O)=0$.
Not only can Mittag-Leffler's quickly be proved by first proving the vanishing theorem (a path followed by Hörmander here), but that sheaf-theoretic formulation suggests the statements and proofs of analogous theorems for arbitrary open Riemann surfaces and for (Stein) manifolds of arbitrary dimension.