I though those were called tautologies, but I just found out that that is incorrect. Is there a term for a statement like "I have lied", that becomes irrefutably true as soon as I say it? In this example, either I have lied in the past and I am speaking the truth about it, or I have never previously lied; this is my first lie.
The question in the title seems to be different from the elaboration below it.
In pragmatics, utterances are called "speech acts". Specifically, sentences like I now pronounce you man and wife are an illocutionary speech act, and more specifically, are declarations. These become true with just their utterance.
The elaboration below the question's title seems to allude to the liar paradox, which is beyond the scope of pragmatics. After all, the content of our speech need not be bound by rules of logic.
To complement a little prash's answer, let me clarify something.
In Logic, a tautology is any sentence that is true by virtue of its logical structure. In this case, the truth values of the atomic sentences in it doesn't matter. So it will be true in every possible interpretation.
In other case, if a sentence is true but is not a tautology, then is true by the combination of the logical structure and the truth value of atomic sentences.
Now, some authors consider the liar paradox to be true and false. This is called dialetheism, in this view self-contradictory statements are considered "true contradictions".
There would be a class of statements that are about speaking. And some of these statements would become true if and only if you utter the statement. Like "I can't keep my mouth shut", where making the utterance makes it true (while writing it on a piece of paper doesn't). Or "I'm speaking now". This kind of statement would belong to a larger class of "self-referential statements".
There are statements falling into the category of "self-fulfilling prophesies" that are a bit more indirect. Like "riding a bike is really difficult, you'll fall off and hurt yourself", where the listener loses all confidence in their bike-riding and promptly falls off and hurts themselves when they try it.
Something like "with all the stolen goods that you are openly carrying with you, I wouldn't be surprised if that police officer would arrest you" could likely cause exactly what was uttered to happen, if the police officer hears it. Not sure if it falls under "self-fulfilling prophecy".
Orders. An officer yelling "everyone stands still" and promptly everyone stands still. So you see there are many different kinds of statements that become true by being uttered.