I know that stalling DC motor can cause overheat because of excessive current. If i will limit the current to the rated current of motor, is there still issue to damage the motor ? to be more specific I have 24v worm geared motor and I want to stall it for 3-5 seconds with rated current. I think the gears will get warm, but how critical will it be for the motor.
It depends but it should be okay. The main failure mode in the motor is due to the resistive heating of the windings when current is flowing through them. Since the resistance does not change with speed, the heat generated will be the same whether stalled at rated current or at full speed with rated current.
One issue to consider is that in most DC motors only two coils are energised at any point in the cycle (the six step pattern for 3-phase motors). If the motor is rotating this means that each coil only operates at a 66% duty cycle. When stalled two coils will conduct 100% of the time so the heat generated will not be spread evenly around the rotor. This will also apply to the current flowing through the brushes. Depending on the motor design it may be worth derating the current because of this.
Also note that if the motor relies on forced cooling you will clearly have to derate the current due to the loss of airflow.
Regarding the gear this will not have any issues. The torque output from the motor is directly proportional to the current and since you are limiting this to rated, the gear will be fine provided it is designed for the rated torque of the motor.
More info is needed on the motor, and what you are driving it with, but generally.... Yes, you can stall a smaller DC motor briefly (3 to 5 seconds is fine), at its rated full load current. The windings will heat up, and there will be some excessive heating of the commutator, but that usually doesn't affect the service life. By smaller motor, I mean under 3.75KW / 5 HP. Over that, there will possibly be more serious issues with the commutator and winding damage if the locked rotor condition is sustained.
The most important thing, is to be sure that you will be stalling it at maximum rated current or under. Most motor controllers allow for much more than 100% rated current.