The half-life period represents the amount of time needed for the substance to decay to half the initial mass.
Since 5 grams is one-fourth of the initial 20 grams, it will need 2 half-life periods (one-half times one-half is one-fourth) so the 20 grams decay into 5 grams.
If one half-life period is 100 years, so it will take 200 years to reduce from 20 grams to 5 grams.