This claim is very widespread, but I haven't seen it in any sources I'd consider trustworthy.
Yes, stress reduces the immune function.
There are numerous peer-reviewed papers on the subject:
Reduced cell-mediated immune function has been found in depressed patients and in distressed persons undergoing threatening life events.
Chronic stress has been associated with suppression of immune function, and there is evidence that the immune system may not adapt over time. Effects of stress accompanying social disruption and psychological depression, when demonstrated, have been consistently adverse.
This review focuses on human psychoneuroimmunology studies published in the past decade. Issues discussed include the routes through which psychological factors influence immune function, how a stressor's duration may influence the changes observed, individual difference variables, the ability of interventions to modulate immune function, and the health consequences of psychosocially mediated immune dysregulation.
Psychoneuroimmunology is actually a fully fledged field of study:
Psychoneuroimmunology (PNI) is the study of the interaction between psychological processes and the nervous and immune systems of the human body.