When I heard that a friend of mine finished his PhD thesis with 909 pages, I wondered if there has ever been a longer thesis in (pure) mathematics?
I am not sure that this is a good question, because the length of a thesis is obviously highly dependent on factors such as line spacing.
Having said that, it is possible to give a definitive answer to the question as written, even in the restrictive form asking about pure mathematics:
Lan, Kai-Wen Arithmetic compactifications of PEL-type Shimura varieties. Thesis (Ph.D.)–Harvard University. 2008. 1077 pp.