Bakers have found that dough develops best around 78F(25C). If the dough is too cold, it will rise too slowly. If the dough is too hot, it will rise too quickly which can result in not enough flavor development, and sometime off-tastes being created by yeast that are out of their preferred temperature range.
Bakers have also found that the only really effective control they have over temperature is through water. It's easy for most of us to use hotter or colder water as needed.
To make a dough the right temperature, subtract the room temperature and flour temperature (in Fahrenheit) from 240.
If you want to get even more precise, subtract how much your dough temperature will rise in kneading from that. When you knead dough, the friction of the flour grains will cause the dough temperature to rise. Some mixers heat up the dough more than others, and whole grain flours heat the dough more than refined flours, so it is a good idea to check each recipe.
Determining how much the dough will heat up in kneading is very simple. Take the dough's temperature when it just comes together, and then again when you are done kneading it. The difference is how much the dough heated up. The first time, just use 5 degrees.
A quick example. Your room temperature is 70 degrees, your flour temperature is also 70 degrees (more often than not, the flour and room will be at the same temperature). You have found that your kneading heats the dough by 10 degrees. So, you calculate 240-70-70-10, which is 90. You should use 90-degree water to get the correct dough temperature.
What about our friends who use Celsius or Centigrade? Your ideal dough temperature should be about 25C. So, the rule for Celsius would be 80. Subtract your flour and room temperatures, along with the temperature rise from 80.
There are two last wrinkles to the rule of 240 (or 80). In extreme weather the formula may call on you to use water that is too hot (more than 100F, or 38C), or water that is too cold (less than 40F or 4C) for the health of the riser (yeast, starter or other preferments). The goal in this case is to protect the riser from direct contact with the hot, or cold, water. I put the water into my mixing bowl, put the flour on top of that, then add the riser and mix it into the flour. This will protect the riser from the extreme water temperature, as the water temperature will change as soon as it mixes with the flour.
The last wrinkle is that when you are using sourdough or other preferments the rule of 240 becomes the rule of 320. Take the temperature of the sourdough or other preferment as well as the temperature of the flour, water and room. Subtract all from 320, rather than 240. If you are using Celsius, this becomes the rule of 105.