Hair is at its weakest when wet. Furthermore, the friction between your hair and the pillow increases the likelihood of breakage. So, if you have to wash your hair at night, wait until it's completely dry before turning off the lights.
Never sleep with wet hair