Motor describes the motion generating unit, in the case of an automotive engine it is the block and the pistons. Engine describes the natural capacity of a machine to generate productive purpose. A fire engine, a boat engine, a racing engine, etc.... these use motors to do specific things and so they are engines.
The basic difference between engine and motor is that the motor works on the principle of electromagnetic induction in which due to changing magnetic field a certain motion is produced while in the case of engine we cant applied this principle of electromagnetic induction so we can say that engine requires some fuel to operate.
The basic difference is what they use to produce mechanical work. Engines use thermal energy of some form of steam and oil. A motor is converting electric energy. An engine burns fuel, a motor uses some other processed energy source like electricity. An engine is a machine, but not all machines are engines.
essentially there is no difference in the meaning of the words. there could, however, be a difference if you use them in referenced sentences. mostly though, the words are the same and can be interchanged.