Why are 成语 (idioms) four characters long? Are there 成语 with more or less than four characters?
Taken from my.chinese.cn:


  成语为什么四字者为多？这大概是因为四字容易上口。如我国古代的诗歌总集《诗经》，就以四字句为多，古代历史《尚书》，其中四字句也有一些。后来初学读的三、百、千《三字经》《百家姓》《千字文》，其中后两种即全为四字句。《四言杂字》《龙文鞭影》初、二、三集，都是四言。这虽然是训蒙书，也足以说明四字句之为人所喜爱、所乐诵。


Why are idioms mostly four characters? This is basically because four words are catchy. Our country's famous book of poetry, 《诗经》, mostly uses four-character sentences, and the historical book 《尚书》 also has many four-character sentences. Then there are the (三、百、千) 《三字经》《百家姓》《千字文》, the latter two of which use four-character sentences. 《四言杂字》《龙文鞭影》 1st, 2nd and 3rd collections all have four words. Although these are books for educating small children they also illustrate people's enjoyment of four-character sentences.

You can find some examples of longer idioms at Wikiquote:


  
  天高皇帝遠。
  Tiān gaō huáng dì yuǎn.
  "The sky is high and the emperor is far away" — used as in carefree (lawlessness).  
  自助者天助。
  Zì zhù zhě tiān zhù
  Literally: Those who help themselves, God will help. Meaning: God will help those who help themselves.
  


You can find some 3 character idioms (in Chinese) at chengyu.itlearner.com.