My apologies for the delay
At 10 your granddaughter is too young to decide who she lives with - although her wishes will be taken into account they will not be decisive.
If you believe that her spending more time with you would benefit the child and indeed the mother then a meeting with a Family Mediator
to see if as a family you can reach an agreement that helps them both.
This is a pre requisite for any Court application in any event.
You would need permission from the court to even make the application for an Order that the child lives with you; her biological father would have to be involved, and the fact that the child has confided in anyone else makes success unlikely
However if you believe that the current position places the child at risk then your only option is to involve Social Services who will place the child with you if they believe that the risk is sufficiently severe.
None of this will e easy - so try family negotiation first
Please ask if you need further details