Dear Student,
Sulphur has higher electron affinity as compared to the oxygen.
Reason : Due to small size of oxygen as compared to sulphur and large electron density of oxygen as compared to sulphur, inter electronic repulsion is higher in case of oxygen which results in less energy being released when an electron is added to oxygen, due to very less stability after the electron is added, which is due to the high inter electronic repulsion in very small oxygen atom. Hence electron affinity value of oxygen is lower. It is an exception to the general periodic trend of electronic affinity values.
Regards