You'll unlock the Gummiphone after completing the short Dark World section after Olympus. After the long cut-scene where you receive the phone, you'll complete a Gummiship section to head to Twilight Town.
On arrival, you'll be attacked by Nobodies, followed by a Heartless whirlwind thing. After you've defeated these, you'll be shown how to take photos with Hayner, Pence & Olette. Once Goofy takes the group photo, you'll finally be able to snap your first photo.
to bring up the photo mode and press
to take a picture.