It has an atomic mass of 35.5 because of the readings obtained when it is put in a mass spectrometer, and how these are used to find the Mr. Chlorine has two main isotopes: Cl-35 and Cl-37. In a given sample, there is 25% Cl-37 and 25% Cl-35.
The equation used to find the Mr of the element is this: (25*37)+(75*35)/100
Which is 35.5.
So it's an average mass of an element and all of its naturally occuring isotopes, so won't always be a whole number.