When writing a chemical formula from the name of a compound, you must familiarize yourself with the names of the elements/compounds involved in the chemical name, and any/all prefixes in the name.
The prefixes are an indicator of how many atoms of one element are in the formula name:
The most common prefixes are as follows:
mono = one
di = 2
tri = 3
tetra = 4
penta = 5
hexa = 6
hepta = 7
octo = 8
nona = 9
deca = 10
When writing formulas, the first element will only have a prefix if there are more than one of those atoms present. Since phosphorus does not have a prefix, one molecule of this compound will have one phosphorus atom.
Iodide is the anionic form of iodine (I-1). Iodide has a -1 charge because it is one electron away from having a full valence shell. Since penta precedes the name of iodine, this tells us that one molecule will have 5 iodine atoms.
Phosphorus is in group 5 of the periodic table, however, since it is in the third energy shell, it can form more than 3 covalent bonds because phosphorus has d-block stability so it can push its electrons into the 3d shell to accommodate the bonding electrons from the 5 iodine atoms. So this molecule will not have a formal charge.
The chemical formula of your compound is PI5