The gunman opened fire at the famous archaeological site just outside Mexico City, wounding at least six others, before killing himself, the authorities said.