How to turn a coffee machine on/off with a microcontroller?
Since you're a beginner at electrics/electronics, I strongly advise not attempting to modify the coffee machine or work with mains voltages unless you can find someone experienced to check your work. Instead, plug the coffee machine into a ready-constructed outlet that you can switch on and off using a signal from your Photon. If you're in the US then this looks ideal, though of course it's your responsibility to be sure it's suitable for your intended use.

For a more general answer if the linked product is not suitable: obviously there are Wifi-connected mains sockets available (e.g. the TPlink Smart Plug and many others) that you could control via their API, but if you or your project supervisor feel that using an off-the-shelf IoT device would be 'cheating' then another idea would be to get a 'dumb' remote-controlled socket, like this or the equivalent wherever you live, which is operated by a low-powered radio transmitter. You could then modify the remote so that a digital GPIO output from the Photon can 'press' the button on the remote by connecting the two contacts of the button together. 

You could do that using a reed relay, as long as the Photon's output can supply enough current to drive it, or an optoisolator - I'm sure you can find example circuits using either of those devices on here or elsewhere.