Before thinking about aircraft, it's first helpful to think about the physics behind what happens to air as it heats up.
As the temperature of a parcel of air increases, the individual particles on average have greater energy. This results in them having greater movement. The resulting higher energy collisions result in the average particle spacing increasing. This means that the density of the air decreases.
The air being less dense is going to have an impact on two things; it is going to reduce the lift produced by the wings and reduce the amount of power prod by the engines.
Why does it reduce the lift produced by the wings?
There is a positive correlation between the lift a wing produces and the rate at which air is flowing past it. As the density of the air drops, the wing has to travel at a higher velocity through the air in order to retain the same amount of lift. For the purposes of taking off, this increases the ground speed required in order for the wings to achieve enough lift for takeoff.
Why does it reduce the amount of power produced by the engines?
Thrust provided by engines (whether propeller or turbine) works basically the same as lift from a wing, but in the direction of travel. As a result, it experiences the same relationship between air density and this "lift".
Going back to the original question, it was asking with the maximum temperature for an aircraft varies with altitude or weight. While an aircraft may have a general maximum operating temperature, the limitation is usually imposed by the length of the runway available at the airport. As we've seen above, lowering the air density both increases the takeoff speed required and reduces the thrust available.
As a result, if you had two otherwise identical airports, but one airport was at a higher altitude than the other, the maximum temperature that would allow aircraft to take off would be lower as it has a lower air density to begin with due to the higher altitude.
Likewise, weight is going to have a negative effect on takeoff distance required as greater weight results in a greater lift requirement from the wings to overcome it. This means that an empty aircraft can take off at higher temperatures than a fully laden one given the same takeoff distance.
This topic was also discussed by Mentour during one of his livestreams:
This post was modified 3 months ago 3 times by Jonathan Price