The style HRH Prince/Princess is governed by the 1917 Letters Patent of George V and the 2013 LPs of QEII.
Under those LPs the following people are HRH Prince/Princess:
The children of the monarch - Charles, Anne, Andrew, Edward
The male-line grandchildren of the monarch - William, Harry, Beatrice, Eugenie, Louise, James, Richard, Edward, Michael, Alexandra
The wives of any male HRHs - Camilla, Sophie, Kate, Brigitte, Katherine, Marie-Christine
The children of William - Baby C and any others (under the 1917 LPs only a son would have been HRH but The Queen gave HRH to ALL of William's children - but not Harry's who will get it on her death and the accession of Charles unless new LPs are issued when necessary).
The question of Louise and James and why they don't use HRH has nothing to do with Edward's title but to do with the fact that at the time of his marriage he requested that any children been styled as the children of an earl. There has been some debate as to whether the fact that The Queen approved this decision was enough for them to lose it forever or whether they still have it but don't use it.
The children of the Dukes of Gloucester and Kent aren't HRH Prince/Princesses because they are the great-grandchildren of the monarch - which is why Harry's children, born in the present reign won't have HRH Prince/Princess but will move up when Charles becomes King - unless Harry follow's Edward's lead and leaves them without the titles.
Peter and Zara, along with Margaret's and Mary's children in the previous generations, don't have HRH for the simple reason that they are descendents through a female.