When a connection is made to the computer running TeamViewer, the information about each connection is written to a text file.
You can view it by opening TeamViewer by clicking the “Advanced” menu and then selecting “Open log files …”.
In the opened directory, usually C:\Users\USERNAME\AppData\Roaming\TeamViewer, you can open the text file “Connections incoming” and see the history of incoming connections, TeamViewer ID of the client that was connected, name of his computer, time, etc.