For primary teeth it depends on cooperation. Sealing is painless but requires the child to hold still and keep the tooth strictly dry. Once a primary molar has fully erupted and before it decays, if the child cooperates the seal can be done — most are ready around three and a half to four and a half years old.
For permanent teeth: the first permanent molar ("six-year molar") erupting around age 6 almost always needs sealing — do it as soon as it has fully erupted.