There are different definitions for both depending on the application to which it is put.
For instance, to a mechanical engineer an engine produces energy or power whereby a machine consumes it.
difference in a motor and an engine.
A motor is converting electric energy into mechanical energy. A engine is converting chemical energy into mechanical energy.