The Lump-sum Withdrawal Payments from the National Pension must apply within two years after leaving Japan.

The Japanese National Pension system is compulsory for anyone over the age of 20 who has an address in Japan, regardless of nationality. (This does not apply if you become a member of the Employees' Pension Insurance system that you enroll in at a company, etc.)
Under the present circumstances, the National Pension will not be paid until the age of 65.
Therefore, if you return to Japan before turning 65 and no longer have an address in Japan, and you have been enrolled in the National Pension system for less than 10 years, you can apply for the Lump-sum Withdrawal Payments.
However, please note that if you do not apply for this Lump-sum Withdrawal Payment system within two years after leaving Japan, you will not be able to apply for it thereafter.
If you leave Japan to a country with which Japan has a social security agreement (the United States, South Korea, Germany and 22 other countries), the period covered by the National Pension system in Japan will be combined with the period covered by insurance in that country. (In this case, you cannot apply for the Lump-sum Withdrawal Payment system.)