This varies for the engine design, and is also during the cycle and according to use e.g. running lean is hotter. For a particular petrol engine a figure for the average temperature in the cylinder during combustion stroke is 820°C. Near the walls the temperature is closer to the engine block and cooling system temperature, but in the middle of the flame it might be from 1650-2750°C (3000-5000°F) with 1950°C more likely, and the exhaust (manifold) can be 980°C. In some ways these temperatures are related to materials too. The engine design is a compromise between efficiency, power, smooth operation, reliability, emissions. With a petrol engine preignition/detonation is always just around the corner, so design tends to focus on that.
The auto-ignite temperature of diesel or petrol fuel is not much different, around 250°C. This is the temperature the fuel ignites by itself. Octane rating affects this in a petrol engine (to prevent pre-ignition as well as detonation). The energy in the burning fuel is a little higher with diesel. The compression is higher too, so this adds some heat before ignition.
For diesels the air temperature at the end of compression is 450 to 675°C. Peak temperatures during burning are like 2030°C.
The second link is a paper with some interesting plots. Here a diesel engine was converted to a spark ignition engine using CNG (compressed natural gas). You can see that at different engine speeds the diesel peak combustion temperature can be hotter or cooler, though at higher speeds (3600-4000RPM) they start to diverge with the CNG being cooler. There is also some attempt to explain these effects, in terms of fuel burn efficiency. Figure 8 shows maximum temperatures at different speeds, with diesel hotter at higher speeds as it is burning more efficien