The mathematical answer is that a resistor is a two-terminal electric device which obeys, or you could say enforces, Ohm's law: V=IR.
V is the voltage between the two terminals, I is the current flowing from one terminal to the other (through the resistor) and R is the value known as resistance. For an ideal resistor, R is a constant and does not depend on V, I, or anything else. Another way to describe Ohm's law is to say that the voltage across a resistor and the current through it are proportional. The constant of proportionality is R, the resistance.
A fundamental consequence of physics is that resistors convert electric potential energy into heat. So they tend to get warm when current flows through them. Real resistors have maximum allowable power dissipation, and also, they may have R which depends on temperature slightly, and other shortcomings from the ideal.
As far as how resistors are made, well, real resistors are constructed from materials which have a conductivity somewhere in between insulators (dielectric materials) and conductors (such as copper wire). If you can determine the path current takes through the resistor, making that path longer increases the resistance. Making the cross-section wider decreases the resistance.
As far as what makes materials good conductors... Well, generally good conductors have mobile electrons at the molecular level. Good insulators do not. Good resistors are somewhere in between.