This term is often used when referring to anime characters that are children or have very childishcharacteristics. Loli's usually are usually little children between the ages of 1-13.
Loli is typically used to define a female with child like characteristics and appearances regardless of age. IF a female has huge tits it is NOT a loli despite the short stature.
ORIGINAL/TRUE Definition (used when lolis were invented in the Comic Market in Japan): an anime girl who is under the age of 13.
Alternate New Japanese Definition: same as the original definition but now sexualized.
Western Definition: A fictional character under the age of 13.
OTHER Western Definition: A fictional woman with flat boobs or who looks like a child.
Dumb people's definition: An anime girl under the age of 18.
This word stems from the term "lolicon" (which, itself, combines the terms "lolita" and "complex" (generally referring to a person with a deviant interest in young girls)).
The term "lolita" finds it's roots in the classic literature novel of the same name ("Lolita", that is) by the author Vladimir Nabokov which is the tale of a 33 year old man's sexual relationship with a 12 year old girl.
Popular application of the term "loli" can mean any female character (typically from an anime) who appears to be a child but I would argue that a true "loli" is a female character between the ages of 6 and 14 who has not yet begun to physically mature while a "legal loli" is a female character who APPEARS to be a child but has reached the age of maturity (typically 16 to 18 tears of age).
This is just my opinion based on years of delving into Japanese popculture. Hope it helps!
"She appeared to be a loli but she was really a 26 year old collegeprofessor!" "A true loli is the ONLY girl for me!"