No, taking a picture of a goldfish will not stun them.
A camera flash is simply a burst of light and is not powerful enough to harm a fish. A very powerful strobe light could potentially cause harm, but ordinary photography will not.
Still, be mindful of the fish's well-being. Avoid sudden movements or loud noises that might stress them.