In post-war Germany there was the “Werwolf” brigades, which were some kind of guerrilla units that were supposed to carry out sabotage and killings in the allied-occupied zones of Germany. Although the real extent of their activities and their effectiveness are disputed, it is undeniable that they wrought tangible effects in terms of suffering for a lot of people in post-war Germany, especially in the areas of Germany under Soviet occupation. At least one scholar (Perry Biddiscombe) estimates, in his monography on the subject, that there were between 3000 and 5000 deaths directly attributable to Werwolf actions and the subsequent reprisals; one of the biggest actions was the blowing up of an ammo dump in Ústi nad Labem (in today’s Czech Republic) on July 31, 1945, killing 27 and wounding several dozens. That triggered the “Ústi massacre” as a reprisal, wherein at least several dozen ethnic Germans were lynched.
And there were plenty of arrests as well. In Soviet-controlled areas, it has been determined that at least 10.000 Germans (mostly young people) were sent to prison camps on the suspicion of being part of the Werwolf groups. A large amount did not come back. However, it is not possible to get exact numbers here, because archives are sorely lacking.
There is more information about the amount of civilians arrested in the other occupation areas, especially the areas under US and British control. There, by the end of 1945, more than 100.000 Germans (both soldiers and civilians) were held in mostly makeshift prison camps to “prevent Werwolf activity”.
Werwolf groups were considered beaten by 1948. But they were not the only ones in Germany. There were others; for example, in 1946, 80 Germans from the so-called “Edelweiss Piraten” group (ironically it was the same name used by an anti-nazi resistance group) were arrested when getting ready to assassinate 400 persons (between allied military commanders and German government officials that were working under the allied occupation forces, including the then prime minister of Bavaria), and they had in their possession caches of weapons and ammunition, including anti-tank rockets.
Interestingly enough, this lasted essentially until 1949 (year of the creation of the modern state of West Germany and its counterpart, East Germany).
Things were not dissimilar in Japan under the occupation - there were also cases of terrorism, guerilla attacks and similar examples of post-war anti-US activity (and that does not include the isolated cases of Japanese soldiers fighting the war in the jungles of the Philippines and Southeast Asia until the 1970s).
So, anyway. There was indeed terrorism after WWII in occupied Germany and Japan. What made it stop? I do not know. It is tempting to say that, in Germany, it was the creation of the German state(s) in 1949 what proved instrumental, but I suspect that it would be simplistic to assume so. In Japan, my theoriy (100% extracted straight from my behind) is that it possibly was the realization that the US was actually a guarantee against a hostile and rather close communist China.