I heard that if you have bad sleep habits, your skin condition gets worse. Is this true?

Yes. Our bodies need adequate sleep to rejuvenate. Poor sleeping habits lead to high cortisol levels overnight which causes undo stress to our bodies. Cortisol should be high in the day to let us deal with life stressors and low at night so we can recooperate. Since our skin is the largest organ and the most visible one, it ll definately show up on our skin if we are stressed 24/7.
Sleep. Yes. Sleeping less or more does damage to multiple areas and increase chance of premature death.