All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
The stepfather is a Mahram (permanently unmarriageable) even after he divorces her, as long as he consummated the marriage with her. So it is permissible to look at him and talk to him like with other Mahram men. However, if he divorced her before consummating the marriage with her, then he is a non-Mahram. Allaah says (what means): {…and your step-daughters under your guardianship [born] of your wives unto whom you have gone in. But if you have not gone in unto them, there is no sin upon you.} [Quran 4:23]
The step-grandfather is like the stepfather. But the step-uncle is not a Mahram. Please refer to fatwa 312058.
Finally, you should know that the relatives that you are obliged to keep ties with are the relatives by family lineage, such as the brothers, sisters, maternal uncles and aunts, and paternal uncles and aunts. As regards the in-laws or relatives due to breastfeeding, such as the stepfather or stepmother, then it is not an obligation to keep ties with them in the same manner as the relatives by family lineage, but it is desirable.
For more benefit, please refer to fatwa 197695.
Allaah knows best.