What can cause a stepper motor to overheat can be related to a few things. First, it good to know that stepper motors will normally be hot to the touch and you should not worry about this. There is a ton of current running through the coils of a stepper motor, and current will cause heat to build up.
Energy comes in many basic forms: movement, heat and light. Stepper motors don't produce light, so we can rule that out, so you have movement and heat. When the stepper motor is not moving, the current is still trying to make sure the stepper motor is holding its position and since movement is not a factor here, heat will build up.
If the heat worries you, you can keep the cnc machine moving, or turned off. There will still be heat when moving, but not all of the current is being used as heat. You can also consider lowering the allowable current draw using the stepper motor driver's dip switches.