There are a lot of factors. Some are engine specific others are aircraft specific. Most WEP or MIL restrictions had nothing to do with overheating the engine itself, but rather overheating specific parts in the engine, like piston heads and ball bearings.
Your right there GScholz. The main factor on engine tempature is going to be your rich and lean settings, which are going to be dialed in based on you EGT readings. You are going to be adjusting your the fuel mixture of your engine based on the ALT that you are flying and mainly on what your EGT is telling you for CLY head tempatures. The first thing that is going to burn up in an engine that is running hot, because for lean mixture, (assumeing cooling system is working properly) is the pistons and the valves. These items have no Direct contact with the cooling fluid, but are in direct contact with the hotest gasses. Running an engine too lean is going to burn it up, running an engine to rich will cool CYL temps but also leads to fowling of the combustion chamber, and reduced power. The best running engine, as far as power, is one that is about to burn up.
WEP alone should not lead to an engine overheating (again assumeing the cooling system is working properly). However it will lead to much greater wear and tear on the engine compoents, mainly (but not limited to), pistons, crankshaft bearings, wristpin bearings, and head gaskets. Mixture will cause an engine failure, but this will normaly happen before the cooling system is overheated, to the point of engine failure.
got to go for now, might add more later.