TeamViewer's sessions will last just as long for the free version as for the paid one, with a maximum time limit of 8 hours.
However, if users would like to set a limit in order to avoid idle sessions that last all day despite no one benefiting from them, users can define an idle session timeout from anywhere between 30 minutes to 8 hours.