Is turning into stone as a result of waiting for someone for a long time derived from Japanese legend?
Stone legends are indeed pretty common just as TurkeyFried stated. Most of these are based on loyalty towards a person (most common in anime is waiting for a loved one).
It is said that the petrifaction version originates from Vietnam

Hòn Vọng Phu (Statue of Husband Waiting)

But nowadays in TV shows and such they give their own meaning to it and reasoning.
You can check this out for some more examples of this phenomena.