Performance of NaI(Tl) detector for gamma-ray spectroscopy