How far does the definition include different lengths of last line and still be considered a limerick?

Depends on the source you consult, musick.

Webster's: five anapestic lines, of which lines 1, 2, and 5 are of there feet, and rime, and lines 3 and 4 are of two feet, and rime
The Lure of the Limerick (1967, 1993) (paraphrased description): same as Websters, but: (1) may omit a line's initial weak beat; (2) may add trailing weak beat or beats at end of line, if done consistently over all rhyming lines.
WordNet ® 1.6, © 1997 Princeton University: 5 anapestic lines with a rhyme scheme aabba [states no line-lengh requirement]
AHD®: five anapestic lines usually with the rhyme scheme aabba. [states no line-lengh or rhyme-scheme requirement]

http://www.sfu.ca/~finley/discussion.html (with more discussion)
http://dictionary.com