This depends on whose perspective you want to look at it in. From the perspective of Melody herself, the answer is "A Good Man Goes to War". In fact, that episode is her BIRTH, and she is seen as a newborn baby.
From the Doctor's perspective — and the perspective of the viewer and the real world — her first appearance is "Silence in the Library". This is when the Doctor first meets her (aside from his forgotten encounters with her in The Eternity Clock), and also her death.