An AC motor is one that runs from alternating current: Current that alternates direction periodically.
(There are 120 alternations, 60 complete "cycles" of flowing first one direction and then the other, per second in North America... 50 cycles in the rest of the world. This is the "frequency" of the AC.)
A DC motor is one that runs on direct current: Current that always flows in the same direction, such as from a battery.
How they differ inside:
With only one exception I can think of, a good way to think of this is that all motors are really AC motors inside. "DC motors" simply include a way to convert the incoming DC to AC. The part that does this is called the "commutator."
(The exception is the "homopolar" motor.)
Imagine a compass needle: a very lightweight bar magnet mounted on a shaft and free to pivot.
Now imagine an electromagnet placed with one of its poles next to the compass. For efficiency, make the electromagnet the shape of a squared-off "U" and put one of its poles on either side of the compass.
Now send DC through the electromagnet. What happens? Because "opposite poles attract," the compass needle rotates so that its north pole is next to the electromagnet's south pole, and vice versa. But it won't keep rotating once it's in that position.
If we send AC through the electromagnet, though... during the first half-cycle, the electromagnet gets magnetized in one direction, and the compass needle rotates accordingly. During the second half-cycle, the electromagnet's field is reversed, and the needle continues to turn to follow it! Repeat. That's an AC motor. Not a very efficient one, and it has other practical problems, but it is possible to make a compass needle spin this way. With some upgrades, we can hitch the "compass needle" to a rotating shaft and make it do work.
Digression: Nikola Tesla's flash of genius was this: He knew that a changing magnetic field will induce current in a nearby conductor. And that that current would create *another* magnetic field, of like polarity to the first one, hence opposing it. So he didn't need a permanent magnet on the rotor, just metal... or in more powerful motors, coils. The a.c. in the outside electromagnet (the "stator coil") induces current in the rotor, or the rotor coils... which creates a similarly alternating magnetic field...which in turn opposes the field from the stator coil. Because of this opposition, the rotor turns. Because the incoming current is alternating, the rotor keeps turning. This is the "AC induction motor" in a nutshell.
Back to the compass: What if we have only DC? How can we get the compass needle to spin? If we apply DC to the coil, the needle turns and points one way... then if we reverse the connections to the electromagnet, the current in the electromagnet flows the other way, so the stator coil's field is reversed, so the compass needle turns another half turn. Then we can reverse the current again and... we can make it keep turning. We did that by making our own AC.
We can do the polarity reversal (making AC) with a switch. Suppose we have a mechanical linkage so that as the compass needle turns, just as it arrives at one position with the needle aligned with the electromagnet, the rotation of the needle flips the switch. Now it has to keep rotating. After it completes another half-turn it flips the switch again. Voila! We have a "DC motor".
In a real motor this switching function is usually done with "brushes" and a set of contacts mounted on the motor shaft, called the "commutator", and the magnets on the rotor are electromagnets too, which get power from the commutator... and they usually make at least three-phase AC instead of single-phase... but it's the same principle.
Notice that the AC motor's speed is more or less locked to the AC's frequency, but the DC motor's speed is determined by the load and the incoming power. It always makes AC at a frequency that provides a balance between these two.
There are several different arrangements of the connections of DC motors, including one called a "universal winding" that will run on either AC or DC.
In the little "DC brushless" fan and spindle motors that are in every PC, the switching is done with MOSFETs and a Hall-effect sensor that senses the rotor position. And those motors DO have permanent magnets, not coils, on the rotor. But again, it's the same notion of the motor "making its own AC". As the rotor turns the incoming current is switched to various coils placed around the rotor, to cause the magnets on the rotor to turn to follow the magnetic field.
Hope this helps.