A motor consumes energy to generate power so does an engine.
Principally they are the same.
But Engines are Prime Movers which means they themselves generate the energy(usually heat) and convert it to power eg. automobile engines use the heat from the fuel to create power
Motors on the other hand take their energy from an external source ( eg. Electric power plants, Compressors in-case of air-motors) and convert it to rotary motion and power.