Naphthalene balls are kept with cloths because when they kept in cloths sublime slowly and after sublimation there will be no residue left. And hence their work is to avoid the insects coming in contact with cloths which damage the cloths.
Hence, naphthalene balls are kept within the cloths or kept with cloths.