Suppose $K\subset \mathbb{C}^n$ is a compact subset and $f:\mathbb{C}^n\setminus K\to \mathbb{C}$ is a holomorphic function. Then, provided $n>1$, $f$ extends to a holomorphic function defined on the whole $\mathbb{C}^n$. This is the Hartogs' extension theorem, and a proof can be found e.g. somewhere in the very beginning of Griffiths-Harris.
This theorem is still true if one replaces $\mathbb{C}^n$ by a connected open subset $U$ of $\mathbb{C}^n$ (upd: and takes $K$ to be a compact subset of $U$ that does not disconnect it, or else there may be a problem even with a locally constant function), see e.g. theorem 2 in http://www.encyclopediaofmath.org/index.php/Hartogs_theorem
I would like to ask if this theorem can be generalized to other complex manifolds (e.g., to Stein manifolds). If there is an answer in the algebraic case, that would be particularly interesting.