What are some examples of theorem requiring highly subtle hypothesis? I would like you to expose and explain briefly some examples of theorems having some hypothesis that are (as far as we know) actually necessary in their proofs but whose uses in the arguments are extremely subtle and difficult to note at a first sight. I am looking for hypothesis or conditions that appear to be almost absent from the proof but which are actually hidden behind some really abstract or technical argument. It would be even more interesting if this unnoticed hypothesis was not noted at first but later it had to be added in another paper or publication not because the proof of the theorem were wrong but because the author did not notice that this or that condition was actually playing a role behind the scene and needed to be added. And, finally, an extra point if this hidden hypothesis led to some important development or advance in the area around the theorem in the sense that it opened new questions or new paths of research. This question might be related with this other but notice that it is not the same as I am speaking about subtleties in proof that were not exactly incorrect but incomplete in the sense of not mentioning that some object or result had to be use maybe in a highly tangential way.
In order to put some order in the possible answers and make this post useful for other people I would like you to give references and to at least explain the subtleties that helps the hypothesis to hide at a first sight, expose how they relate with the actual proof or method of proving, and tell the main steps that were made by the community until this hidden condition was found, i.e., you can write in fact a short history about the evolution of our understanding of the subtleties and nuances surrounding the result you want to mention.
A very well known and classic example of this phenomenon is the full theory of classical greek geometry that although correctly developed in the famous work of Euclides was later found to be incompletely axiomatized as there were some axioms that Euclides uses but he did not mention as such mainly because these manipulations are so highly intuitive that were not easy to recognize that they were being used in an argument. Happily, a better understanding of these axioms and their internal respective logical relations through a period of long study and research lasting for millennia led to the realization that these axioms were not explicitly mention but necessary and to the development of new kinds of geometry and different geometrical worlds.
Maybe this one is (because of being the most classic and expanded through so many centuries and pages of research) the most known, important and famous example of the phenomena I am looking for. However, I am also interested in other small and more humble examples of this phenomena appearing and happening in some more recent papers, theorems, lemmas and results in general.
Note: I vote for doing this community wiki as it seems that this is the best way of dealing with this kind of questions.
 A: Some of Euclid's theorems rely on axioms of betweenness that he was not aware of.
Hilbert's axioms: https://www.math.ust.hk/~mabfchen/Math4221/Hilbert%20Axioms.pdf
A: Gödel's ontological proof requires a subtle assumption that if $\varphi$ is an essential property of $x$ then $x$ must possess $\varphi$.  The first time that Gödel showed his proof to anyone was in 1970, when he provided Dana Scott with a terse writeup. In this writeup, Gödel's  definition of the essence of $x$ omitted the conjunct $\varphi(x)$, thereby omitting the subtle assumption.
Many years later, Christoph Benzmüller and Bruno Woltzenlogel Paleo discovered, using a computer proof assistant, that omitting the subtle assumption not only creates a gap in the proof, but leads to a contradiction.  See their 2016 paper, The Inconsistency in Gödel’s Ontological Argument: A Success Story for AI in Metaphysics.
To be fair to Gödel, it seems likely that he knew the assumption was needed, since older private notes of his include the assumption. Also, when Dana Scott presented the proof to others, he included the assumption without indicating that he was doing anything more than reporting what Gödel had told him.  (For further information, see page 392 of Volume III of Gödel's Collected Works.)  Nevertheless, it was subtle enough that Gödel did omit it on at least once crucial occasion (even if by accident), and the fact that its omission leads to a contradiction seems to have gone unnoticed for over 40 years.
A: The convergence conditions for the Fourier series of a function $f:S^1 \to \mathbb{R}$ are a good example. The investigation of convergence conditions for Fourier series was a major motivation for Cantor's set theory and Lebesgue's measure theory. Depending on what kind of convergence you want, the conditions can be very subtle. For example, if you want the Fourier series of a continuous function to converge pointwise everywhere, then I don't think that there is any nice set of necessary and sufficient conditions known.  Various sufficient conditions are known, e.g., the Dirichlet conditions, which are fairly subtle.
Nowadays, I think it is generally considered that asking for convergence everywhere is the "wrong question"; one should ask for convergence almost everywhere. Then the most famous theorem is Carleson's theorem that the Fourier series of a function in $L^2$ converges almost everywhere.  The hypothesis here is easy to state, but the way that the hypothesis is used is subtle.  There are various proofs known now but none of them is easy.  Note for example that Kolmogorov's first paper gave an example of a function in $L^1$ whose Fourier series diverges almost everywhere.
A: There is Euler's formula $$V - E + F = 2.$$ Today, we might not think of the hypotheses as being especially tricky.  But Lakatos's classic Proofs and Refutations  makes an entertaining case for its subtlety. 

If Lakatos does not convince you, consider Euler's Theorem for Tilings. Suppose we have a tiling of the plane; take a finite portion of it, apply the standard Euler formula, and divide by $F$. Intuitively, as we take larger and larger portions, $V/F$ and $E/F$ approach limiting values $v$ and $e$ respectively, and we obtain Euler's Theorem for Tilings:
$$v - e + 1 = 0.$$
However, even if the limits $v$ and $e$ exist, they do not necessarily satisfy Euler's Theorem for Tilings unless the tiling satisfies certain subtle hypotheses.  For example, in the heptagonal tiling below (taken from Grünbaum and Shephard's book Tilings and Patterns), the heptagons get skinnier and skinnier as one moves out from the center, creating a "singularity at infinity." It is not hard to see that $v=7/3$ and $e=7/2$, so $v-e+1 = -1/6$ and not zero.

In the notes to Chapter 3, Grünbaum and Shephard write:

Euler's Theorem for Tilings and its various corollaries are often quoted and used—usually without any indication of restrictions that must be imposed on a tiling to give meaning and validity to this procedure. In contrast to many other cases—in which a cavalier attitude towards mathematical rigor is an aesthetic shortcoming that does not affect the outcome—here many authors have claimed to have proved statements that are actually false. As recent examples we may mention  Walsh (Geometriae Dedicata 1 (1971), 117–124) and Loeb (Space Structures: Their Harmony and Counterpoint, especially Chapter 9).

A: This example has been mentioned elsewhere on MO but seems worth reproducing here.  The abstract of Amnon Neeman's paper A counterexample to a 1961 “theorem” in homological algebra says:

In 1961, Jan-Erik Roos published a “theorem”, which says that in an [AB4∗] abelian category, lim1 vanishes on Mittag–Leffler sequences. …  This  is  a  “theorem”  that  many  people since have known and used. In this article, we outline a counterexample. We construct some strange abelian categories, which are perhaps of some independent interest.

It turns out that the theorem can be repaired by adding some relatively weak hypotheses that are usually satisfied in practice.  That the need for such hypotheses apparently went unnoticed for so long is perhaps evidence that they are "highly subtle."
A: This is one which I've seen trip up a number of students when first learning the material: the hypothesis of admissibility (or acceptability - I learned the latter, but the former seems more common) in the context of numberings of unary partial computable functions (or equivalent objects like c.e. sets).
Results like Rice's Theorem and the Recursion Theorem are generally presented for a specific numbering whose details are quickly forgotten; the motto "all reasonable numberings work the same" is introduced somewhere around this point, and is mostly true. However, the right notion of "reasonability" is not usually obvious, since presentations tend to focus on the following two features of the canonical numbering $\Phi:=(\varphi_e)_{e\in\mathbb{N}}$:


*

*The numbering construed as a partial binary function $\langle e,x\rangle\mapsto\varphi_e(x)$ should itself be computable.

*For every unary partial computable $f$ there should be some $e$ with $f\simeq \varphi_e$.
By themselves these properties are not enough to get the standard results to apply: the usual extreme counterexample is a Friedberg numbering, which is a numbering satisfying the two properties above such that every partial computable $f$ has exactly one index (so Rice's Theorem and the Recursion Theorem each fail basically trivially).
Instead, we need to strengthen the second bulletpoint above as follows:


*

*(Admissibility/acceptability): For every binary partial computable $f$ there is some total computable unary $g$ such that for each $e$ we have $$f(e,-)\simeq \varphi_{g(e)}.$$
This amounts to a kind of "universality" of the numbering in question; roughly speaking, every other numbering needs to be translatable into it. This turns out to be exactly what we need to deduce all the basic results about the usual numbering, and indeed so far as I'm aware there really are no essential differences between admissible numberings. Moreover, once this sort of universality occurs to us as something important we're led to consider general comparisons between numberings of various systems, and this leads to several interesting topics (see especially Rogers semilattices).
A: 
Theorem. Assuming the axiom of choice, the countable union of countable sets is countable.

Proof. Let $\{A_n\mid n\in\Bbb N\}$ be a family of countable sets, and so we can write $A_n$ as $\{a_{n,m}\mid m\in\Bbb N\}$.
Let $A$ be the union, and define $f(a) = 2^n3^m$ such that $n$ is the least such that $a\in A_n$, and $a=a_{n,m}$. Easily, this is an injection so the union is countable.

The trained eye, of course will notice the use of the axiom of choice immediately. We choose an enumeration of each $A_n$. But this is very subtle and usually people will not notice that at first.
And of course, this use of choice is necessary. Indeed, it is consistent that the real numbers are a countable union of countable sets! (Still uncountable, though.) 
A: This is not a perfect example because the subtle hypotheses in question were not "unnoticed"; nevertheless I think it fulfills several of your other criteria.  Let us define the "Strong Fubini theorem" to be the following statement:

If $f:\mathbb{R}^2 \to \mathbb{R}$ is nonnegative and the iterated integrals $\iint f\,dx\,dy$ and $\iint f\,dy\,dx$ exist, then they are equal.

The Strong Fubini theorem looks innocent enough, but without any measurability hypotheses, it is independent of ZFC. For example, Sierpinski showed that Strong Fubini is false if the continuum hypothesis holds.
In the other direction, a paper by Joe Shipman investigates a variety of interesting hypotheses that imply Strong Fubini, e.g., RVM ("the continuum is real-valued measurable"), which is equiconsistent with the existence of a measurable cardinal.
Here's another one: Let $\kappa$ denote the minimum cardinality of a nonmeasurable set, and let $\lambda$ denote the cardinality of the smallest union of measure-zero sets which covers $\mathbb{R}$. Then the assertion that $\kappa < \lambda$ implies Strong Fubini.
A: How about the classic equality $0.999...=1$?
Proofs of this fact either assume the series defined by this infinite decimal representation converges, or initially prove convergence using the fact that the common ratio of the geometric series has norm less than unity. But the convergence works only because we use a number system where that norm is in fact less than unity. To illustrate how this cannot be taken for granted, render the decimal expansion as the series
$(9/10)+(9/100)+(9/1000)+...$
and render each term into $3$-adics. Since the initial term $9/10$ and the common ratio $1/10$ can each be expressed as a $3$-adic integer, so can every term in the series. But they all end with $...00$ and thus the sum can never converge to $...01$. Nor can the sum converge to anything else since the $3^2$ place is $1$ in every term. The latter gives a hint of where the breakdown occurs: the terms of the geometric series do not tend to zero because in $3$-adics the common ratio actually gives $|1/10|=1$, not $|1/10|<1$.
