As VIVIT site from Accademia della Crusca explains, we use the construction pensare che + subjunctive, credere che + subjunctive, ritenere che + subjunctive, etc. when the subject of the principal clause is different from that of the subordinate clause. For instance:
- (Io) penso che Marco arrivi in ritardo.
- (Noi) credevamo che (tu) ti fossi perso.
But when the subject of the principal clause is the same as that of the subordinate clause, we use the structure pensare di + infinitive, credere di + infinitive, ritenere di + infinitive, etc. as you can see in these examples:
- (Io) penso di arrivare in ritardo.
- Marco (lui) pensa di arrivare in ritardo.
- (Noi) credevamo di esserci persi.
This is mostly that way, but it's true that you sometimes can find some instances of sentences constructed with pensare che, credere che, etc. in which the subject of the principal clause is the same as that of the subordinate clause, even if they are not so common. Let's explain this in detail.
As you can see at Treccani encyclopedia, all the above sentences contain what are called "proposizioni completive oggetive", that is, subordinate clauses which have the role of direct object of the principal clause. A subordinate clause which is the subject of the principal clause is called a "proposizione completiva soggettiva". The constructions with pensare che, credere che, etc. are called "explicit", whereas the ones with pensare di + infinitive, credere di + infinitive, etc. are called "implicit".
The book Italiano by Luca Serianni explains at section XIV.6:
a) Quando si ha identità di soggetto – grammaticale o logico – il costrutto esplicito è meno comune dell'implicito; ma si
trova, con l'indicativo, nel registro colloquiale («ogni tanto dice che è malato» Calvino, cit. in SCHMITT-JENSEN 1970: 181) oppure quando si voglia dare particolare rilievo all'oggettiva: «io le dico che ho bisogno d'attaccarmi con l'immaginazione alla vita altrui» (Pirandello, L'uomo dal trope
fiore in bocca, III 12).
That is, when the subject of the principal clause is the same as that of the subordinate clause, as we have seen above, the explicit constructions are less common than the implicit ones; but they may be found in colloquial registers in which the indicative is used, as in the above example by Calvino or as in the example given in the comment by @mle (but notice that a sentence as "Pensi che hai torto?" is only used in colloquial registers and grammars of standard Italian usually advise against this use of indicative) or in some instances in which one aims to give a particular enfasis to the subordinate clause, as in this example from the book Baracche. Appunti di prigionia. 1944-1945, by Alessandro Dietrich:
Ma per forza devo ridere... credi che tu sia la prima a farmi le carte?
And referring to the explicit constructions, Serianni in the avobe cited book adds:
c) Si adopera invece senza possibilità di scelta, con soggettive e oggettive, quando l'azione della completiva è posteriore:
«gli pareva che non avrebbe esitato, se fosse stato di giorno, all'aperto, in faccia alla gente: buttarsi in un fiume e sparire» (Manzoni, I Promessi Sposi, XXI 52).
That is, when the action expressed by the subordinate clause refers to a future moment with respect to the one expressed in the principal clause, one must use the explicit construction, as in the above example by Manzoni or this other one from Treccani encyclopedia
Penso che domani andrò al mare.