In Genesis 16:3 it is written:
"So Sarai, Abraham's wife, took Hagar the Egyptian, her handmaid, at the end of ten years of Abraham's dwelling in the land of Canaan, and she gave her to Abraham her husband for a wife."
But in Genesis 21:12-13, HaShem addresses Abraham by calling Hagar simply "your handmaid", and not "your wife".
I did not understand if Hagar really was Abraham's second wife or just his pilegesh;the issue seems to me controversial in the Jewish tradition.
In some sources Hagar is considered a wife:
"Although there is no explicit proof for the matter that one must take another wife if he has not had children after ten years of marriage, there is an allusion to the matter, as the verse states: “And Sarai, Abram’s wife, took Hagar…after Abram had dwelled ten years in the land of Canaan, and gave her to Abram her husband to be his wife” (Genesis 16:3)."
In other texts Hagar is qualified a pilegesh:
Rashi on Genesis 25:6:1
"The concubines — The word is written deficient, (without י, but our texts have a י in both places) because he had only one concubine, Hagar, who is identical with Keturah. Wives are those whom a man marries with a marriage-contract (Ketubah): concubines have no marriage contract, as we explain in the Talmud (Sanhedrin 21a) in reference to David’s wives and concubines."