When to retract a submission due to excessive length of peer-review process
There can be multiple reasons for lengthy review process.
1) Your work is very novel and its hard to find a reviewer.
2) You submitted your article to a journal who's scope is not fully relevant to your research area. According to my experience this is one of the major reason.
3) The ignorance of handling editor.
First make your own assessment if your work is very novel or if you have submitted to a journal who's scope is not fully relevant to your research area in both cases you may expect a much longer review process.
if its not the case 1) and 2), then Check the average time of first decision for recently published article, and contact handling editor after passage of average expected time. If Editor don't reply for another extra 25%~30% of average time, then write a withdraw letter and mention the unexpected delay as a reason for withdrawal to EiC.