Writhing math is more art than science, but as a general rule, you want to put definitions and notations as close to their use as is reasonably possible. This generally helps in at least two situations your reader might find themselves in:
The reader is skimming and sees notation they don't recognize. It's reasonable to expect that they will first look in the immediate vicinity of where it was used - perhaps tracing backwards to its first use - to look for an explanation. If you put your definition right before the first use, they will probably find it.
The reader is reading from start to end and doesn't understand a definition's purpose. Conversely to the previous point, this reader will be well-served by having the notation be used right after it is introduced. In the best-case scenario, by the time you are defining anything in a paper, an attentive reader will already see why we want to make that definition and will therefore easily integrate the new notation into their understanding of the article.
Note that this advice precludes putting a huge chunk of prose whose only purpose is to introduce definitions and notation - such a block will be difficult for any reader to make use of. If you have a lot of notation or your article is very long (e.g. it is actually a book), you could include an alphabetized reference for notation that just lists symbols and what they mean (but this should be thought of as a table not as prose).
In practical advice, where you put definitions will depend on their purpose. If your proof centers around defining some novel object or collection of objects, you would want to give an informal big picture outline of your proof near the start of the article and then devote a chunk of text to formalizing that big picture - wherein you will introduce definitions. If a definition is used to kick off a series of lemmas, define it right before those lemmas and right after you give an outline of why it makes sense to define. If it's just a little trick to get you through a single lemma, define it in the body of that lemma.
Basically, you can ask yourself questions to decide where to put each definitions: Do you need it to sketch the broad outline of the proof? Define it at the start where you provide such an outline. Does it appear as a technical detail in several proofs? Define it before the first proof that needs it. etc.