The documentation does not have an example of how to use this WiFi function and states that it returns a char*. On the Photon I am getting a build error stating:
error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
You are getting back a pointer to an internal buffer created by the function, so it’s always good practice to copy the contents rather than just relying on the pointer to stay valid.
So you could go either of these ways
String mySSID = String(WiFi.SSID());
// or my favourite because I don't like String ;-)
char myCharSSID[64];
strcpy(myCharSSID, WiFi.SSID());