The subscriot 2 means that in the formula there are two parts of K, and the subscript 1 (implicit) for S, indicates that there is one part of S.
This is, the formula gives the ratio of the elements K and S in the compound, which is:
2 atoms of K : 1 atom of S.
Answer: there are 2 atoms of K and 1 atom of S in a molecule of K2S.