Mathematicians ahead of their time?
My top vote would be for Ramanujan. With severely limited resources, he was able to formulate deep number-theoretic identities that the top mathematicians in the field at the time hadn't the imagination to conceive, let alone the slightest clue to prove. A close second would be Evariste Galois--dead at the age of 20, he had already established the foundations of what is now an entire algebraic theory named after him. The world will never know what mathematics he could have discovered had he lived.
I think Asaf makes a good argument against people like Galois and Cantor. As he says, if Cantor didn't develop set theory, who would have? I think to find someone who is arguably ahead of their time, you need to find a mathematician whose work was ignored, and then reinvented in substantially similar fashion by others much later, so that you can say “look, this guy had it, but it was too soon, and then later someone else got credit for inventing the same thing.” And so I nominate the logician Charles Sanders Peirce (1839–1914). When you study the early history of logic, it sometimes seems that every other sentence is “This work was anticipated by C.S. Peirce, whose contribution was unfortunately overlooked.”
To give a very narrow and incomplete idea of Peirce's accomplishments in mathematical logic I will quote briefly from the Stanford Encyclopedia of Philosophy:
In 1870 Peirce published a long paper “Description of a Notation for the Logic of Relatives” in which he introduced for the first time in history, two years before Frege's Begriffschrift, a complete syntax for the logic of relations of arbitrary [arity]. In this paper the notion of the variable (though not under the name “variable”) was invented, and Peirce provided devices for negating, for combining relations (basically by building upon de Morgan's relative product and relative sum), and for quantifying existentially and universally. By 1883, along with his student O. H. Mitchell, Peirce had developed a full syntax for quantificational logic that was only a very little different… from the standard Russell-Whitehead syntax, which did not appear until 1910 (with no adequate citations of Peirce).
Peirce introduced the material-conditional operator into logic, developed the Sheffer stroke and dagger operators 40 years before Sheffer, and developed a full logical system based only on the stroke function. As Garret Birkhoff notes in his Lattice Theory it was in fact Peirce who invented the concept of a lattice (around 1883).
(Burch, Robert, "Charles Sanders Peirce", The Stanford Encyclopedia of Philosophy (Summer 2013 Edition), Edward N. Zalta (ed.))
For sheer amount of time ahead, may I suggest Brahmagupta (597–668), Jayadeva (950 ~ 1000) and Bhāskara II (1114 ~ 1185), Indian mathematicians whose work in indeterminate quadratic equations and many other branches predated European attempts by more than half a millennium.
In particular, consider their work on chakravala, an elegant and powerful method to find solutions to Pell's equation $x^2 = Ny^2 + 1$. Circa 1150, Bhāskara II had a solution for the case $N=61$, while in Europe it was given as a challenge by Fermat and first solved in 1657. More than one hundred years later (in 1766), Lagrange's "general" method to solve this problem was still much more complicated and inelegant than chakravala, which for its application requires nothing but elementary arithmetic.