Maybe she likes more “mood” lighting and not the overhead florescent lighting? Or she’s just conserving energy. But regardless, it’s rude to walk into the room and turn off the lights you have on without asking or saying anything. Especially when you’re study and “using” the lights and if she’s not getting ready for bed.
Why don’t you talk to her about it? Ask why she does it and explain that you like the lights on when you do your homework. Hopefully the two of you can come to some sort of agreement regarding when the lights wilI generally be turned off.
Sharing a small space with some is hard and it can be complicated to figure out how the space will be used in a way that works for both.