There are two types of sonnets: the Italian sonnet or Petrarchan sonnet and the English sonnet or Shakespearean sonnet. Aside from their origin, they differ in structure.
The Petrarchan sonnet is composed of an octave which is the first eight lines, followed by the sestet which is the last six lines. Its rhythm follows the pattern abba, abba, cdecde or cdcdcd. An example would be "London, 1802" by William Wordsworth.
The Shakespearean sonnet is composed of three quatrains followed by a couplet. Its rhythmic pattern is abab, cdcd, efef, gg. Example is Sonnet 73 (That Time of Year Thou Mayst).