The program determines visitors by the IP addresses. If a request from an IP address came after some time (timeout) since the last request from this IP, it is considered to belong to a different visitor. The timeout is set to 30 minutes by default but you can change this value in Options > Analysis > General. Requests from spiders aren't used to determine visitors unless the “Count spiders as visitors” option is enabled.
After the program determined which hits belonged to a visitor, it can determine visit length as time between the first and the last requests of the visitor.
You can find average visit length in the Activity Statistics > Daily table.
If you wish to get visit length for a specific visitor, you can get it in the Log Details > Visitors table in dynamic HTML report (these reports are available in the Enterprise edition). You need to find the visitor (e..g using filters) and click the Details button in the Visitor ID column to get detailed information on the visitor including visit length. You can find a dynamic report sample at http://demo.weblogexpert.com/Login.as...
After the program determined which hits belonged to a visitor, it can determine visit length as time between the first and the last requests of the visitor.