Juliet speaks these lines in act 1, scene 5 a short time after meeting Romeo for the first time, holding hands with him, kissing him, and falling absolutely in love with him at first sight. It's only after Romeo has left the Capulet's masked ball that Juliet thinks to find out who he is.
Tybalt had only to hear Romeo's voice to know who he was, even though Romeo was wearing a mask; but, as unlikely as it might seem since Romeo and Juliet have lived in Verona their entire lives, Juliet has never seen, spoken with, or even heard of Romeo before she met him at the Capulet's party that evening. Apparently, Juliet doesn't get out of the Capulet house very much, or speak with anyone who comes to the house, or speak to anybody who does get out of the house, except for the Nurse.
To be fair to Juliet, Romeo didn't ask Juliet's name, either. (In fact, Romeo is never told her name, but somehow he knows her name two scenes later in the "balcony scene.")
It seems odd, though, that at a party at the Capulet home, which is full of Capulets and their friends, Romeo is surprised to find out that the girl he was kissing is a Capulet, or at the very least someone associated with the Capulet family.
ROMEO: Is she a Capulet?
O dear account! my life is my foe's debt (1.5.125–126).
Nevertheless, at the time Romeo and Juliet meet, Juliet has no idea who he is, and in all that hand-holding and kissing they didn't even exchange first names, so she asks her Nurse who he is.
NURSE: I know not.
JULIET: Go ask his name.—If he be married,
My grave is like to be my wedding bed (1.5.142–144).
Without leaving Juliet's side, or hesitating for even a New York minute, the Nurse has a ready answer.
NURSE: His name is Romeo, and a Montague,
The only son of your great enemy (1.5.145–146).
"Go ask his name" would seem to be an implied stage direction (as many of Shakespeare's stage directions are), but even if the Nurse is very quick about it, who would she ask? Tybalt knows who he is, but Lord Capulet already kicked Tybalt out of the party for threatening to disrupt the festivities by brawling with Romeo. Lord Capulet knows who Romeo is, too, but he's already gone off to bed. Romeo, Benvolio and all of the other "maskers" have left the building, leaving only Juliet and the Nurse. It's unlikely, too, that anyone associated with the Montagues would endanger themselves or Romeo by telling anyone associated with the Capulet household who he is.
In any event, Juliet learns that her newfound love's name is Romeo, and that he's a member of a family who are sworn enemies of the Capulets.
JULIET: My only love sprung from my only hate! (1.5.147)
Juliet is clearly distressed to learn that the love of her life - quite possibly the only love of her life so far - is a member of the hated Montague family, with whom the Capulets have been feuding since time immemorial, probably for a reason that no one can even remember.
JULIET: Too early seen unknown, and known too late! (1.5.148)
As other Educators have noted, Juliet is lamenting the fact that she didn't know who Romeo was, or to which family he belonged, before she met him and fell in love with him.
It might not have made any difference even if she had known—it certainly made no difference to Romeo that Juliet is a Capulet, given his boldness in invading the Capulet's orchard to get a look at her, and maybe do some more hand-holding and kissing—but Juliet doesn't seem to be quite as impulsive as Romeo is (except for falling in love with him at first sight, of course), and she might have been more circumspect about meeting with him, or avoided meeting with him at all.
In which case, Shakespeare's play would likely have been titled Romeo and Rosaline.