How is the mass of the Earth determined?
According to Newton's Law of Gravity based on attractive force (gravitational force) that two masses exert on each other:
$$F=\frac{GmM}{r^2}$$
Where:

$F$ is the gravitational force
$G = 6.67 \times 10^{-11}\ \mathrm{m}^3\ \mathrm{kg}^{-1}\ \mathrm{s}^{-2}$ is a constant of proportionality
$M$ and $m$ are the two masses exerting the forces
$r$ is the distance between the two centers of mass.

From Newton's second law of motion:
$$F=ma$$
Where:

$F$ is the force applied to an object
$m$ is the mass of the object
$a$ is its acceleration due to the force.

Equating both the equations:
$$F = \frac{GmM}{r^2} = ma$$
$$\frac{GM}{r^2}= a$$ (The $m$'s canceled out.)
Now solve for $M$, the mass of the Earth.
$$M = \frac{ar^2}{G}$$
Where $a = 9.8\ \mathrm{m}\ \mathrm{s}^{-2}$, $r = 6.4 \times 10^6\ \mathrm{m}$, and $G = 6.67 \times 10^{-11}\ \mathrm{m}^3\ \mathrm{kg}^{-1}\ \mathrm{s}^{-2}$.
$$M = 9.8 \times (6.4 \times 10^6)^2/(6.67 \times 10^{-11})\ \mathrm{kg}$$

Hence,
$M = 6.0 \times 10^{24}\ \mathrm{kg}$