How and why time stops inside a black hole?

I have recently learned that black holes are dead stars, who are collapsed, and attracted other objects towards it and this process results in a very very large gravity. So light is also unable to escape. Also if someone goes to its event horizon and returns safely, then he will be younger and in earth, time will have passed much.

So my question is, how time slows down there?

To answer this appropriately, we have to take a look at the Schwarzschild-metric, which is the solution to Einstein's field-equations for a spherical mass-distribution (like black holes). It is (in natural units $G=c=1$)
$ds^2 = -( 1-\frac{2M}{r})dt^2 + \frac{1}{1-\frac{2M}{r}} dr^2 +r^2 d\Theta^2+ r^2 sin \Theta d\phi^2$
If we now fall directly into the black hole for instance, we continuously lower the $r$ coordinate. Now maybe you can see for yourself what happens, when $r$ approaches $2M$. For $r \to 2M := r_s$ (called the 'Schwarzschild-radius') the coefficient of the differential time-coordinate in the line element vanishes, while the radial coordinate diverges. That means that in the vicinity of a black hole's Schwarzschild radius, we need a great amount of time $t$ to make a difference in $r$. This is why 'time slows down there' essentially.