The second equation is always correct, and you can derive the first equation from it.
Here on the surface of the Earth, $d$ is the radius of the Earth $r_e$ plus our height $h$.
$$
F = G \frac{M_e M_2}{(r_e + h)^2}
$$
The radius of the Earth (6,371 km) is huge compared to our height above the surface (at least, when we're near the surface), so we can simplify the equation by assuming $r_e \gg h$ and therefore $r_e \approx r_e + h$.
$$
F = G \frac{M_e M_2}{r_e^2}
$$
$G$, $M_e$ and $r_e$ are all constant, so we bundle them all into another constant $g = \frac{GM_e}{r_e^2}$ and voila
$$
F = gM_2
$$
It's because our mass is irrelevant?
No, it's because the equation assumes that our height above Earth's surface is negligible compared to the radius of the Earth (which most of the time, for me at-least, it is).
Example: Suppose I'm a 70 kg man whose just spent the last week hiking up Mount Everest, which is 9 km above sea level. Using the correct equation we get
$$
F = G \frac{70 M_e}{(6,371,000+9,000)^2} = 685 N
$$
Using the approximate equation we get
$$
F = 70g = 687 N
$$
which is about $0.3$% different. Whether this is an acceptable error or not will depend on how precise you need your calculations to be, but for every-day purposes it's probably fine :)