An engine is generally a collection of mechanisms interconnected to perform a specific task while a motor is a single mechanism - but not necessarily.
Webster defines motor as:
1: one that imparts motion
specifically : prime mover
2: any of various power units that develop energy or impart...