The Mishna in Pirkei Avot says "Al Tarbeh Sicha Im Haisha", do not converse excessively with a woman.
Does this apply to text messages as well?
Avos DeRabbi Nasan (7:3) defines the problem as bringing home gossip to your wife, how you were treated negatively, how you treated others in response, etc.
According to that, the medium of communication - speaking, writing, in person or at a distance - seems irrelevant.
The reason for not engaging in excessive conversation with a woman is explicitly stated, it brings to Bittul Torah (neglecting Torah study) therefore whether it is done through texting, phone call, etc., as long as it takes precious time which could have been dedicated to Torah study it is included in this Mishnah's horaah (teaching).
The full text of this Mishnah in Pirkei Avot (Ethics of the Father's) reads: 5. Yossei the son of Yochanan of Jerusalem would say: Let your home be wide open, and let the poor be members of your household. And do not engage in excessive conversation with a woman. This is said even regarding one's own wife—how much more so regarding the wife of another. Hence, the sages said: One who excessively converses with a woman causes evil to himself, neglects the study of Torah, and, in the end, inherits purgatory.