On Wednesday afternoon in a grocery store in Kandel, Rhineland-Palatinate, the boy allegedly pulled a knife out on the young woman and stabbed her.
The girl, a German national, had entered the store with a companion who was not the suspect, the prosecutor said in a statement.
The reason for the argument was not revealed.
Following descriptions given by passers-by to police, the Afghan teen was arrested and is now awaiting trial.
According to investigators, the girl had broken up with the boy in early December; the prosecutor in Landau in southwest Germany has ruled out a terrorist motive.
It was not known whether the suspect was a refugee.
The German teenager died later Wednesday afternoon in hospital from her wounds.