This is an interesting topic and been the subject of much critical thought for the past 400 years. So little is known about William Shakespeare that scholars have spent thousands of hours pouring over all of his writings in the hopes that "he" would show himself -- but alas, it is shaky. It is not safe to assume that the author of a work agrees with what his characters say and think, and in many places in the plays, there are all kinds of contradictions, so that is some rather unsafe territory.
When it comes to the sonnets, scholars had thoughts that they could find some answers to who Shakespeare was, what he believed in, what he valued, what he thought about various topics. Unfortunately, the sonnets create a mystery as well. Through the ages, the scholars have evaluated the sonnets and put them in the order in which they are typically ordered today -- they did this by looking for common themes and any interconnectedness between two or more. From that, they could see that the sonnets created a rough sequence of ideas: sonnets that praise a young man, sonnets that show a bond of friendship between the speaker and the young man, sonnets that show the positive and negatives of their relationship, sonnets that show deep insight and resolution about life in general, sonnets that are very philosophical, and lastly, sonnets about the speaker's relationship with a dark lady. Unfortunately, all that scholarship still doesn't provide any proof that the words on the page reveal anything about the man who wrote them. All the sonnets may just be the creative output of wordsmith and nothing more. He never directly names himself or the intended audience of the sonnets, and without those two things, the sonnets are an incredible body of poetic genius by a man who still remains a mystery.