The above excerpt is from Herstein's book "Topics in Algebra". It confuses me by two reasons: Firstly, in the first definition the mapping is into but in the second the mapping is onto. Why the author uses into and onto?
Could anyone clarify this distinction in definitions, please?

In Herstein's terminology (which is rarely used nowadays) an isomorphism is just an injective homomomorphism.
On the other hand, two groups $G$ and $G'$ are said to be isomorphic if there exists a surjective (onto) isomorphism $\phi\colon G\to G'$.
Herstein uses the preposition “into” to generically introduce the codomain, so a map $f\colon X\to Y$ is from $X$ into $Y$. The preposition “onto” is used when the map is surjective.
The terminology used by Herstein is quite old-fashioned and now it's commonly preferred to say “injective homomorphism” or “monomorphism” instead of “isomorphism”. Note that, in Herstein's terminology, the existence of an isomorphism $\phi\colon G\to G'$ doesn't imply that $G$ and $G'$ are isomorphic. Only the existence of an “onto isomorphism“ does.
Herstein's book was first published in 1975; at the time terminology was still unsettled, but my algebra teachers always used “isomorphism” for “bijective homomorphism”. It's always best to check the book for definitions and usage and keep a “dictionary” for translations.