The first time is at the end of Kingdom Hearts II, when Sora and Riku read Kairi's letter and the door of light opens.
The second is in the secret ending of Birth by Sleep, where Ansem the Wise and Aqua are talking. Ansem mentions the name of the one who will help — and then they show different locations where the characters who spoke: Sora.