You are thinking of the Principia Mathematica, written by Alfred North Whitehead and Bertrand Russell. Here is a relevant excerpt:
As you can see, it ends with "From this proposition it will follow, when arithmetical addition has been defined, that 1+1=2." The theorem above, $\ast54\cdot43$, is already a couple of hundred pages into the book (Wikipedia says 370 or so); the later theorem alluded to, that $1+1=2$, appears in section $\ast102$, considerably farther on.
I wrote a blog article a few years ago that discusses this in some detail. You may want to skip the stuff at the beginning about the historical context of Principia Mathematica. But the main point of the article is to explain the theorem above.
The article explains the idiosyncratic and mostly obsolete notation that Principia Mathematica uses, and how the proof works. The theorem here is essentially that if $\alpha$ and $\beta$ are disjoint sets with exactly one element each, then their union has exactly two elements. This is established based on very slightly simpler theorems, for example that if $\alpha$ is the set that contains $x$ and nothing else, and $\beta$ is the set that contains $y$ and nothing else, then $\alpha \cup \beta$ contains two elements if and only if $x\ne y$.
The main reason that it takes so long to get to $1+1=2$ is that Principia Mathematica starts from almost nothing, and works its way up in very tiny, incremental steps. The work of G. Peano shows that it's not hard to produce a useful set of axioms that can prove 1+1=2 much more easily than Whitehead and Russell do.
It would not be hard to copy-and-paste the relevant parts of the blog article here, but I am not sure if that is appropriate se.math etiquette; I invite comments on this matter.