Q:

What is the maximum temperature for a photon?

Assuming that the maximum temperature for particles is $10^{32}$ kelvin (i.e., the Planck temperature) and the electroweak symmetry breaking is below $10^{15}$ kelvin, What is the maximum temperature for a photon? For example, if we could heat a photon to above $10^{15}$ kelvin, would it remain a photon or would it transform into some other type of particle such as the mathematically modelled electroweak $W_1$, $W_2$, $W_3$, or $B$ bosons?
Also, for an optional bonus point question, Would string theory or M-theory make a big difference for these calculations?

A:

This turns out to be more complicated than you (probably) thought. The electroweak transition that produces the photon, $Z$ and $W^\pm$ is due to an interaction with the Higgs field, but it depends on the energy of the Higgs field.
At the risk of oversimplifying, a quantum field has states of increasing energies. There is a lowest energy state, the vacuum state, and then adding energy excites the field to higher energy states. A quantum field is excited by exchanging energy with other quantum fields, so for a field to have a higher energy means all the fields it interacts with will also have a higher energy. In effect this is just thermal equilibrium. A hot object sustains its temperature because it is continually exchanging energy with its surroundings. We have a system in thermal equilibrium with a well defined temperature.
So we can talk about a temperature for the Higgs field, and all the other fields it interacts with, by considering the equilibrium system in which all the quantum fields are excited and all continually exchange energy with each other. At the risk of oversimplifying yet again, the Higgs field is symmetric at high temperature and asymmetric at low temperature, and it is the transition from the high to low symmetry state that causes electroweak symmetry breaking and the conversion of the $W_1$, $W_2$, $W_3$ and $B$ bosons to the photon, $Z$ and $W^\pm$. The temperature at which this occurs is the $10^{15}$K that you refer to in your question.
The point of all this is that a single very high energy photon does not constitute a high temperature any more than a single very high energy gas molecule constitutes a high temperature gas. So if we consider a single photon and ramp up its energy then we don't expect anything special to happen as we reach then pass the electroweak transition energy. The photon will just carry on being a photon. As we approach the Planck energy then we may well need to start considering stringy effects but right now we have no concrete understanding of physics at these energies so it's impossible to say what happens.
The situation is very different if you consider a system of many particles, e.g. the debris from a high energer collider experiment, and consider a system in which the average photon energy is high. In this case as the energy approaches the electroweak transition energy that energy is shared with all the field including the Higgs field, and as a result the Higgs will be in its high energy symmetric state and the photons will transform back to combinations of the $W_3$ and $B$ bosons.

