there are essentially the same things: both have a form of a 'commutator' (for DC, slip rings for AC, mind you a DC generator has SPLIT rings) , have field magents, coil, and axis to rotate on.
roles are very distinct: the motor turns electrical energy into kinetic or mechanical energy, and the generator does the exact opposite.
thats pretty much all u need to know about the differences between motors and generators. HOWEVER, you might like to know that the generator usually has a kind of a 'shaft', a handle that can be turned to turn the axis, turn the coil, generate electricity.
there are minor differences in the structures of AC vs. DC though. these are more specific in detail. your textbook should have sufficient detail on these differences.