A possibly simpler method is as follows:
- Set the motor up with a wheel which engages a microswitch (or similar)
Wire the microswitch as SW1, the starting switch as SW2:
With SW2 unpressed, the motor will go until the tab engages the microswitch, breaking the normally-closed side. It stays there until you press the start switch SW2 for long enough to move the wheel off the microswitch.
I once made a doorbell like this, out of a CD-ROM motor and a music-box mechanism. It was arranged to play the whole of the Pink Panther tune. All was fine until the tab broke and it played for about an hour: everybody was hoping their patience lasted longer than the battery.
The tab was glued onto the wheel, marked 2 in Wikipedia image: