My layover time is 7 hours 20 minutes, and I arrive in Terminal 3 and depart from Terminal 1. I have a valid visa of Australia, valid passport of Pakistan, and a valid ticket to Perth, Australia.
I haven't been in CGK in a long while, last time was before Covid, but there's no airside transfer between terminals, and the SkyTrain runs in the public area – it connects the 3 terminals to the SHIA train station. So you must pass through Immigration (manned counters for foreigners, manned counters or e-gates for Indonesians), and Customs (luggage inspection, which often involves passing your luggage through x-ray).
As I said in the comments, T1 doesn't sound right: it handles domestic flights only. T2 is also mostly domestic, plus LCC international flights. So your transfer is probably between T3 and T2.
If your flights had all been in T3, or T2, you wouldn't need a visa. But since you are transferring, you'll need a visa (and if it's a round-trip, you'll need two).