SOP: Talking about the university I am writing my statement of purpose for a PhD in mathematics for various universities. I know that it is a good thing to motivate why you want to go to that university in particular, but I was wondering at what point one should do this.

What I have for the moment is a paragraph in the end where I explain my reasons for applying, and talk about why I think that university in particular should be fitting for me. Is that enough? Or should there be mentions of the university in the whole statement?
There’s no single right way to do this. The important point is that you show you’ve “done your homework,” so to speak. If you prefer to do that in one paragraph as you talk about your future studies, that’s probably fine. If you want to make an initial reference early on, that’s fine, too. So is mixing the references throughout the essay. But don’t overdo it, and don’t come across as pandering. 

Finally, make sure to save your work carefully, and be thorough in your edits. The last thing you want to do is send school X an SOP that has references to school Y!