It's too complicated to explain on here, just google it. I can tell you though it happens from a star so dense that it collapses on itself and makes a strong suction so strong that not even light can escape.
Summary: Black Holes are made when very large stars die. When the star runs out of fuel for nuclear burning in the core it is no longer able to support itself from collapsing under its own weight. The star first collapses and then the outer layers rebound to form a supernovae explosion. What's left at the core is a Neutron Star or a Black Hole depending on the initial mass of the star. To form a Black Hole the mass left at the core after the explosion must be more than about 3 times the mass of the Sun. The star for most of its life probably needds to be between 50 to 100 times the mass of the Sun to eventually form a Black Hole. (Website; http://curious.astro.cornell.edu/question.php?number=349) :D
A black hole is formed when a star of the largest size collapses into a supernova. A supernova can also result in a pulsar or magnetar, but this depends on the size. I cannot remember the numbers they used, but stars that are "a" times to "b" times 'larger than our Sun become' pulsars, stars that are "c" times "d" times '...' magnetars, and stars that are "e" times to "f" times '...' become black holes. Please note that as the letters go down the alphabet they numbers they represent become higher. I hope this makes sense; if not, I cold try and explain it more in comments if you want to ask questions there. Never mind, just read Celeste's answer!