Catholics are able to speak in tongues if they have been given the gift of tongues by the Holy Spirit.
“Tongues” is a kind of prayer that can either be vocalized or internal and it’s when a person is able to pray in a language that they do not know. Not all Catholics are given this gift, but that's okay. All Catholics receive the seven gifts of the Holy Spirit at Confirmation. These are the important gifts that everyone needs to grow in holiness.
Charismatic gifts, like tongues, prophecy, and healing, are extraordinary graces given to some, not because they are more holy but because God wants them to use their gifts to build up the Church.
The first time we hear about the gift of tongues in Scripture is in Acts when the Apostles preach to people from all over the world gathered in Jerusalem. This is right after the Holy Spirit came upon them in tongues of fire, and even though they are preaching to people of many languages everyone understands their Good News. God gives the apostles this gift not for themselves, but for the sake of those around them.
The gift of tongues can also be when someone speaks, 'not to men but to God, for no one understands him, but he utters mysteries in the spirit' (1 Corinthians 14:2). In other words, he speaks a language no one understands. Sometimes when this happens God will give another person the gift of interpretation so that people gathered can hear a message and 'the Church may be edified' (1 Corinthians 14:5). No matter how the gift of tongues is manifested, it is always ultimately given to make the whole Body of Christ holier. As the Catechism explains, 'Whether extraordinary or simple and humble, charisms are graces of the Holy Spirit which directly or indirectly benefit the Church, ordered as they are to her building up, to the good of men and to the needs of the world' (CCC 799).