Is there such a thing as a prayer of thanks? Is there a prayer of repentance?
I do not know of any prayer called a prayer of thanks. There are narrations about a prostration of thanks and about a prayer of repentance.
As for the prayer of repentance, it is preferred for a person who commits a sin to pray two units of prayer and make true repentance to Allah. This is called the repentance prayer.
The Prophet (peace be upon him) said: “Whenever a servant commits a sin, then makes a proper wudû’ and prays two units of prayer and repents to Allah from that sin, Allah will accept his repentance.” [Musnad Ahmad with authentic line of transmission].
If a person receives good news, such as the birth of a new baby or glad tidings of victory for the Muslims, then he may prostrate to Allah in thanks.
This prostration is similar to the one performed in prayer. In such a prostration one may say: Subhân Rabbî al-A`lâ, offer supplications, and praise Allah for the good news that he has received.
When the Prophet (peace be upon him) heard good news, he used to prostrate in gratitude to Allah. Abû Bakr also prostrated when he learned that the false prophet Musaylimah had been killed in battle.