Masturbation in men or women does not negatively affect cognitive processes
As I pointed out in another question in Health.SE, masturbation was a diagnosable psychological condition until DSM II in 1968 (Ley, 2014), and the American Medical Association consensually declared masturbation as normal in 1972 (Planned Parenthood Federation of America, 2003).
Historically, masturbation was discouraged for a variety of reasons including the thought that it lead to mental health problems. However, that was disproved. A lot of the history is talked about in the Planned Parenthood Federation of America's White paper (2002).
The abstract of Coleman, E. (2003) states
Research on masturbation has indicated that, contrary to traditional beliefs, masturbation has been found to be a common sexual behavior and linked to indicators of sexual health. While there are no general indicators of ill health associated with masturbation, it can be powerfully negative or positive for many individuals. As an example, it is widely used in sex therapy as a means of improving the sexual health of the individual and/or relationship. Promoting masturbation as a means of a public health strategy for sexual health is highly controversial; however, there are arguments and evidence that suggest that this may be an important part of any public health approach to improving sexual health.
Whilst POIS and PCT/PCD mentioned by @AlexStone exists, these problems are not actually a result of masturbation. Whilst the causes of POIS and PCT/PCD are unknown, some doctors hypothesise that POIS is caused by an auto-immune reaction, such as an allergy to the males' own semen (Farley, 2011; Waldinger MD, 2016; Reuters Health, 2002) Other doctors suspect a hormone imbalance as the cause. While other causes have been proposed as well, none of the proposed causes seem to fully explain the problem.
With PCT/PCD, the wikipedia article states that some doctors prescribe serotonin reuptake inhibitors, such as fluoxetine, to treat PCT. After two weeks, people reported that, "while sex was less intensely pleasurable, no emotional crash followed."
References
Coleman, E. (2003). Masturbation as a Means of Achieving Sexual Health. Journal of Psychology & Human Sexuality 14(2-3): pp 5-16
DOI: 10.1300/J056v14n02_02
Farley SJ (2011). Sexual dysfunction: Postorgasmic illness syndrome. Nature Reviews Urology. 8(3): 121.
DOI: 10.1038/nrurol.2011.17. PMID: 21513019.
Ley, D. J. (2014). The Myth of Sex Addiction. Rowman & Littlefield. p. 12.
ISBN: 978-1-4422-1305-0.
Planned Parenthood Federation of America (2002). White Paper: Masturbation —
From Stigma to Sexual Health [Free PDF]
Available at: https://www.plannedparenthood.org/uploads/filer_public/8e/f5/8ef53e54-2fcb-4f92-933e-59fa0a09285b/masturbation_11-02.pdf
Planned Parenthood Federation of America (2003). "Masturbation: From myth to sexual health". Contemporary Sexuality. Mount Vernon, IA: American Association of Sex Educators, Counselors, and Therapists. 37 (3): v. ISSN 1094-5725. OCLC 37229308. "Finally, the American medical community pronounced masturbation as normal in 1972 American Medical Association publication, Human Sexuality (Rowan, 2000)".
Reuters Health (2002). Dutch Doctor Identifies Post-Orgasmic Syndrome. [Online]
Available at: http://www.freerepublic.com/focus/news/665820/posts
Waldinger MD (2016). Post-Orgasmic Illness Syndrome. In: Levine S, Risen CB, Althof SE. Handbook of Clinical Sexuality for Mental Health Professionals (3rd ed.). Routledge. p. 380.
ISBN: 978-1-3175-0745-1.