First, we have to know that the Church has three parts: the Militant Church (the Church here on Earth), the Triumphant Church (heaven), and the Suffering Church (purgatory). We are one mystical body of Christ, and thus, we can communicate with the deceased through prayer. There is even a pious tradition in the Church that the souls in purgatory can intercede for us, depending on their stage in Purgatory.
Some pious souls and saints have said that if a soul is very deep down in Purgatory, the soul cannot intercede but rather needs our intercession. Those who are already close to God are more capable of interceding for us, thus there are different levels in Purgatory. Those who are closer to God can ask His permission to know some things that can help their relatives and loved ones.
As a general rule, we can invoke them as long as we know that they were pious and prayerful in their lives and are in Purgatory. Personally, instead of simply chatting with them, I would rather do this in the context of prayer, which is more worthy and respectful. In my opinion, it would be more mature to communicate with them in prayer.
If you have a good and deep relationship with your relative or friend and you know that he/she is pious, then privately, you can communicate with them using your own words. Since it is very personal, it would depend on your relationship with this soul and on how pious this person was when he/she was still living their life on earth.
Dear visitors of Gloria Dei and all who have already written or who will write a personal message to me. I am grateful for your attention, your kindness, for your spiritual support and especially for your sacrifices and prayers for me. God may reward you!