Sleeping with a light on in your bedroom will not hurt you or harm you.
But having a light on in your bedroom can make it hard to fall asleep and stay asleep because most people get to sleep faster and sleep better when the room is dark.
I have a night light on in my bedroom so I can see to get up if I need too.
But I sleep with the light out because I get much better sleep.
Having the light on when trying to sleep makes for a restless night and can mess with your sleep patterns because night is usually associated with sleep.
So humans are meant to sleep when it's dark.