Yes, lack of sleep can affect your immune system. Studies show that people who don't get quality sleep or enough sleep are more likely to get sick after being exposed to a virus, such as a common cold virus. Lack of sleep can also affect how fast you recover if you do get sick.
Does chronic fatigue weaken your immune system?
People with CFS sometimes have weakened immune systems, but doctors don't know whether this is enough to cause the disorder. People with CFS can also sometimes have abnormal hormone levels. Doctors haven't yet concluded whether this is significant, either.
What could weaken your immune system?
Also, infections like the flu virus, mono (mononucleosis), and measles can weaken the immune system for a brief time. Your immune system can also be weakened by smoking, alcohol, and poor nutrition.