Okay, she is 15 and in a dangerous environment for her. You are 18 and in a stable situation for yourself.
In the United States, one can petition to become someone's legal guardian based on such conditions as a threat to one's safety and wellbeing. One, as a minor, can also petition for legal emancipation. If the grandmother agrees, both of those solutions are much simpler.
If you are very concerned for your girlfriend's immediate safety, seek out Child Protective Services, or see if your girlfriend will go to a local mental health center to speak with a social worker to seek resources which may help you both.
Yes, age of sexual consent is 16 in most places, however, most states (i'm in the US) make allowances if the couple has been together previous to the turning 18. In other words, the state usually won't prosecute, but the grandmother still may press charges if she wants to. Wait a few months until your girlfriend is 16, if your relationship is one of such intimacies.
Best to you. You sound like a very caring and thoughtful young man.