Alaykum Salam,
It is allowed provided one prays on time and fulfills all other obligations, Abu Hurayra and many of the early Muslims played it. Here are two Shafi’i responses related to this topic.
Ali and Ibn
Umar – Allah be well-pleased with them – detested chess because of those who neglected worship due to it and because of the gambling and betting involved. This is why it was forbidden (cf. Sahih Muslim vol. IV,no. 5612) and the Faqih of Madina, al-Qasim ibn Muhammad – Allah be well-pleased with him – said: “All that distracts
from remembrance of Allah and Salat is dice (maysar).”
Otherwise, al-Nawawi said “In our school it is makruh, not haram, and this is the position reported from a number of the Tabiin” while al-Qurtubi said in his Tafsir, it is permitted once in a while without being disliked according to the vast majority of the Fuqaha‘ and
despite the misleading words of Ibn Kathir in his Tafsir, “Malik, Abu Hanifa, and Ahmad stipulated that chess is haram while al-Shafi
i disliked it.”
It is established that Abu Hurayra (who entered Islam in the year 7 after the Hijra) and others of the pious Salaf played chess – but not as an all-consuming activity. In the final analysis the correct position in the matter seems that of Imam al-Shafii – Allah be well-pleased with him – who said: “It is disliked and not forbidden, for a number of the Companions played it and countless of the Tabi
in and those after them” while the Hafiz Ibn Hajar said: “There is not one firmly-established narration to prohibit chess, neither sahih nor hasan.” [Fayd al-Qadir.]
Note: The hadith “Whoever plays chess and dice is as one who dipped his hand in swine’s blood” is inauthentic. The correct wording does not mention chess but only dice, narrated from Burayda by Imam Muslim in his Sahih.