These lines appear in act 2, scene 1—known as the "balcony scene"—of Shakespeare's Romeo and Juliet. Juliet has just met Romeo at her family's party, and she's fallen deeply and hopelessly in love with him at first sight—as often happens in Shakespeare's plays. Moments later, she learns from the Nurse that Romeo is a member of the Montague family, the family with whom Juliet's family, the Capulets, have been feuding and fighting in the streets for as long as anyone can remember, for a reason that everyone has long forgotten.
JULIET. Ay, me. (2.1.26)
The big sigh that Juliet lets out when she first appears on the balcony means, "Of all the eligible young men in Verona who find me incredibly attractive and with whom I could fall in love, why did I have to fall in love with a Montague?"
After a few words from Romeo, who's hiding in the bushes in the Capulet's orchard, Juliet continues bemoaning her fate for falling in love with Romeo.
JULIET. O Romeo, Romeo, wherefore art thou Romeo? (2.1.35)
Juliet isn't asking "Where are you, Romeo?" as this line is often misinterpreted. Juliet is asking "Why are you called Romeo?" More to the point, because Romeo and Juliet's families are feuding, she's essentially asking "Why are you a Montague?"
It's interesting that Juliet asks, "Romeo, Romeo, wherefore art thou Romeo?" instead of "Montague, Montague, wherefore art thou Montague?" even though the meter stays the same, and it's the "Montague" part of Romeo's name that's the problem. Perhaps Shakespeare thought that "Montague, Montague" sounded too formal, and, by now, the audience knows quite well that Romeo is a Montague, and using his first name suffices to represent his surname.
As an aside, the way Juliet speaks to Romeo, not knowing that he's hiding in the bushes, is called apostrophe.
JULIET. Deny thy father and refuse thy name. (2.1.36)
In other words, "Deny thy birth, thy birthright, thy heritage, thy inheritance, and thy family name, and renounce thy father, and thy mother, and everybody else in thy family."
This isn't going to happen, and Juliet probably realizes that as soon as she says it, so she withdraws that request, and asks Romeo to do something that he's much more ready, willing, and able to do.
JULIET. Or, if thou wilt not, be but sworn my love
And I'll no longer be a Capulet. (2.1.37-38)
In the overall scheme of things, it would be much easier, and much less traumatic, for Romeo and his family if Juliet changed her name. This is exactly what she would do if she married Romeo. So is Juliet not only asking Romeo to pledge his love to her but also asking him to ask her to marry him? Yes, she is.
At first, Romeo misses the point. Once Romeo comes out of the bushes, he and Juliet talk about what's in a name, and roses that smell as sweet, and being new baptized, and o'erperching walls, and swearing by the moon. In time, though, Juliet brings the conversation back around to the question of marriage, even though nobody has raised the question but her.
JULIET. Three words, dear Romeo, and good night indeed.
If that thy bent of love be honourable,
Thy purpose marriage, send me word to-morrow,
By one that I'll procure to come to thee,
Where and what time thou wilt perform the rite;
And all my fortunes at thy foot I'll lay
And follow thee my lord throughout the world. (2.1.148-154)
After much parting is such sweet sorrow and metaphors, similes, oxymorons, and alliteration galore, Romeo agrees to marry Juliet, and he runs off to Friar Laurence to tell him the good news and make arrangements for the wedding.
ROMEO. Hence will I to my ghostly father's cell,
His help to crave and my dear hap to tell. (2.1 202-203)
Romeo has no idea what just happened, but, unfortunately, it's going to cost both of them their lives—which should come as no surprise to anyone who was listening to the prologue.