As far as British royalty are concerned, under a Royal Warrant of 1917, children of a monarch and grandchildren in the male line are Prince/Princess and HRH automatically, along with the eldest son of the eldest son of the Prince of Wales (the Earl of Wessex's children are technically HRH Prince James and HRH Princess Louise, but their parents have decided that they should be known by the styles of children of an earl - hence Viscount Severn and Lady Louise Windsor).
Dukedoms etc are rather more complicated. The eldest living son of a monarch is automatically Duke of Cornwall from birth or from his parent's accession if later - hence Prince Charles became Duke of Cornwall at the age of three on his mother's accession. When a Duke of Cornwall succeeds as king, the dukedom merges with the crown unless the new king already has a son, to await the birth of the next person entitled. Other dukedoms have to be bestowed, but can then be inherited. For example, the Queen created her second son Duke of York at the time of his marriage. If the current Duke had sons, the eldest would inherit on his death, as has happened with the dukedoms of Gloucester and Kent. The dukedom of York has been unlucky in that respect - only one (Edmund, son of Edward III) has actually produced a son who inherited it). Prince Andrew seems unlikely to produce a son now (he will need to marry again), so on his death the dukedom will become extinct. What I think will then happen is that Prince Charles, having presumably by then succeeded as king, will bestow it on Prince Harry, as Duke of York is traditionally the title of the monarch's second son (exception was Queen Victoria's second son, who was made Duke of Edinburgh.
Grandchildren of a monarch in the female line take any titles from their fathers, so Princess Anne's children are simply Peter and Zara Phillips, and Princess Margaret's are Viscount Linley and Lady Sarah Chatto (nee Armstrong-Jones). Their father is Earl of Snowdon, so the (only) son uses his father's second title by courtesy and the daughter is Lady Christian Name Surname. Any other sons would be the Honourable X Armstrong-Jones.
Male line great-grandchildren of a monarch are not Prince/Princess. Their position is shown by the families of the present Duke of Kent and his brother Prince Michael of Kent. The Duke's elder son uses his father's second title by courtesy and is Earl of St Andrews. The daughter, as the daughter of a duke, is Lady Helen Taylor (nee Windsor), and the younger son Lord Nicholas Windsor. The Earl of St Andrews' elder son (not sure if he has more than one) uses his grandfather's third title by courtesy and is called Baron Downpatrick, daughters are Lady X Windsor. The children of Lady Helen and Lord Nicholas have no titles at all. Prince Michael's children are Lord Frederick Windsor and Lady Gabriella Windsor. Any children they have do not have titles.
Hope this is reasonably clear!
Ann