How do we know the number of atoms in an inorganic compound?
For all compounds, the systematic name of that compound should provide information on the composition and structure. Your case is an example of the nomenclature of binary covalent compounds. Consider the following example:


  dinitrogen tetroxide


The first word in this name tells us which element is first in the formula and how many of them there are. In this example the "di-" prefix tells us we have two of something.

$$\mathrm{dinitrogen = }\ \ce{N2}$$

The second word in the name tells us which element is second in the formula and how many of them there are. In this example the "tetr-" prefix tells us that there are four of something. By convention, we usually use the "ionic" form of the second element in the name even if it is a covalent compound, so "oxide" means "oxygen".

$$\mathrm{tetroxide=}\ \ce{O4}$$

Therefore, the full formula for this compound is $\ce{N2O4}$.

The prefixes are as follows (up to 10, with larger numbers being rare). Note that the trailing "o" or "a" of a prefix is dropped with oxygen to increase ease of pronunciation. 

$$\begin{array}{|c|c|} \hline
\mathrm{prefix} &amp; \mathrm{number}\\ \hline
\mathrm{mon(o)} &amp; 1 \\
\mathrm{di} &amp; 2 \\
\mathrm{tri} &amp; 3 \\
\mathrm{tetr(a)} &amp; 4 \\
\mathrm{pent(a)} &amp; 5 \\
\mathrm{hex(a)} &amp; 6 \\
\mathrm{hept(a)} &amp; 7 \\
\mathrm{oct(a)} &amp; 8 \\
\mathrm{non(a)} &amp; 9 \\
\mathrm{dec(a)} &amp; 10 \\ 
\hline
\end{array}$$


  What about names like iodine monochloride? How many iodine atoms are there in the formula?


The "mono-" prefix is often left out if there is no compound out there that have more than one of those atoms in it. Thus, iodine monochloride is $\ce{ICl}$. Why not iodine chloride? There is another compound out there "iodine trichloride," which is $\ce{ICl3}$.