Repetier M84 in gcode disable motors which is often in end gcode.Most firmwares also have a idle timer and disable motors after some time. For that you need to check firmware config or settings.