Queen Elizabeth I was the monarch when William Shakespeare was born and remained queen until her death in 1603. Elizabeth I had no consort. James I was her successor, and he remained on the throne when Shakespeare died in 1616.
James I married Anne of Denmark in 1589.
Shakespeare's early plays, those written in the 1590s, included both comedies and histories, the latter using the often tumultuous royal successions as inspiration. Shakespeare and his troupe were fairly successful and built their own theater, The Globe, in 1599.
James I was a supporter of the theater. Upon his coronation, the acting troupe changed its name to the King's Men. After 1600, Shakespeare's plays leaned toward tragedies, including Hamlet, King Lear and Macbeth.