How long should punishments be

My niece is 9 years old living with my grandmother And I bc her mother can’t handle her. Her mother was very abusive,they never properly disciplined her and now her daughter has behavior issues. She’s been cursing , hitting my grandmother/ my grandmother doesn’t do much about it and she doesn’t discipline her when she curses or says things like “I’m going to kill you”. I took away the tablet and tv because she’s being very disrespectful. How long should punishments be for a 9 year old.