One school of thought speculates that Shakespeare may have drawn inspiration from his own love life for composing Romeo and Juliet. Shakespeare may have experienced struggles in his own marriage and may have wanted to warn young lovers that love has its dangers and its turmoils. However, we actually don't know all that much about Shakespeare's love life for certain.
The one thing we do know is that, when he was 18, he married a woman 8 years older than he, and their first child was born only 6 months later. We also know that their marriage ceremony progressed rather hastily. Normally, according to ancient legal tradition of the Church of England, banns must be read three consecutive Sundays in a row before the couple is permitted to marry. Banns give the congregation a chance to voice any objections to the marriage. We know that Shakespeare became legally married to Anne Hathaway after only one bann was read. The haste of the marriage plus the birth date of their first child suggests that marriage was a "shot gun wedding," a forced wedding to prevent scandal. We also know that Shakespeare did not really continue to live with his wife. From 1585, after the birth of their twins, until 1592 he moved to London and did not take his family with him. The separation indicates that he may not have really loved his wife, even though passion led to a hasty marriage. Therefore, one school of thought speculates that his own loveless marriage led him to write about the dangers of intense passion.
However, another school of thought recognizes that Shakespeare was an admirer of history, and just like his historic plays, was inspired to write Romeo and Juliet based on historic events. The two warring families in the play actually reflect Verona's two warring political factions, the Guelphs and the Ghibellines. The Guelphs were a family of dukes who were in favor of the Pope reigning over Italy while the Ghibellines were a wealthy agricultural family who supported the continuing reign of the Holy Roman Emperor. The Guelphs saw the Emperor as a threat to their prosperity while the Ghibellines saw the Pope as a threat to their interests. This war between families took place between the 12th and 15th centuries. In 1524, Vicenza Luigi da Porto wrote down the first recorded history of the feud, which he titled what can be translated to "The history of two noble lovers and their piteous death occurred during the reign of Bartolomeo della Scala." His historic account included what was probably an oral history of the two lovers that was already well known in his time period. Shakespeare used all of the facts in da Porto's narrative for Romeo and Juliet. However, well before Shakespeare could write his play, several other writers and poets were inspired by the story and wrote their own pieces. Among the writers and poets, two more that Shakespeare probably drew inspiration from are Arthur Brooke, who wrote the first English version of the story in poetry format in 1562, and William Painter, who wrote a second English version in 1569 ("Verona: The history").
Therefore, most likely, rather than drawing on inspiration from his own life, Shakespeare most likely drew his inspiration from the famous, historic story.