Assuming that you're speaking in units of atoms, you can convert them like so:
$$Grams \Leftrightarrow Mols \Leftrightarrow Atoms$$
Using Avogadro's Constant, we know that 1 mol = 6.022 x 10^23 atoms, allowing us to convert from atoms to mols:
$$\left({\mathtt{4.87}}{\mathtt{\,\times\,}}{{\mathtt{10}}}^{{\mathtt{22}}}{\mathtt{\,\times\,}}{\mathtt{atomsC}}\right){\mathtt{\,\times\,}}\left({\frac{\left({\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{molC}}\right)}{\left({\mathtt{6.022}}{\mathtt{\,\times\,}}{{\mathtt{10}}}^{{\mathtt{23}}}{\mathtt{\,\times\,}}{\mathtt{atomsC}}\right)}}\right) = {\mathtt{0.808\: \!7}}{\mathtt{\,\times\,}}{\mathtt{molsC}}$$
To get grams, we convert again only from mols, to grams. Knowing that 1 molC = 12.00gC we get:
$${\mathtt{0.808\: \!7}}{\mathtt{\,\times\,}}{\mathtt{molsC}}{\mathtt{\,\times\,}}\left({\frac{\left({\mathtt{12}}{\mathtt{\,\times\,}}{\mathtt{gC}}\right)}{\left({\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{molC}}\right)}}\right) = {\mathtt{9.077}}{\mathtt{\,\times\,}}{\mathtt{gC}}$$
Assuming that you're speaking in units of atoms, you can convert them like so:
$$Grams \Leftrightarrow Mols \Leftrightarrow Atoms$$
Using Avogadro's Constant, we know that 1 mol = 6.022 x 10^23 atoms, allowing us to convert from atoms to mols:
$$\left({\mathtt{4.87}}{\mathtt{\,\times\,}}{{\mathtt{10}}}^{{\mathtt{22}}}{\mathtt{\,\times\,}}{\mathtt{atomsC}}\right){\mathtt{\,\times\,}}\left({\frac{\left({\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{molC}}\right)}{\left({\mathtt{6.022}}{\mathtt{\,\times\,}}{{\mathtt{10}}}^{{\mathtt{23}}}{\mathtt{\,\times\,}}{\mathtt{atomsC}}\right)}}\right) = {\mathtt{0.808\: \!7}}{\mathtt{\,\times\,}}{\mathtt{molsC}}$$
To get grams, we convert again only from mols, to grams. Knowing that 1 molC = 12.00gC we get:
$${\mathtt{0.808\: \!7}}{\mathtt{\,\times\,}}{\mathtt{molsC}}{\mathtt{\,\times\,}}\left({\frac{\left({\mathtt{12}}{\mathtt{\,\times\,}}{\mathtt{gC}}\right)}{\left({\mathtt{1}}{\mathtt{\,\times\,}}{\mathtt{molC}}\right)}}\right) = {\mathtt{9.077}}{\mathtt{\,\times\,}}{\mathtt{gC}}$$