If you enable the audit service you'll have this data (and a lot more unless you configure it to exclude what you don't need).
Go take a look at the audit service documentation to learn how to enable it, and then, once you do, try out the audit rest API to search the data.
Once you enable the audit service you can query the audit tables either via the audit REST API or by writing SQL against the database (these are the only tables you should ever query directly). Or you might consider extracting the data and putting it somewhere else that's a bit easier to query and that can scale without causing performance issues on your Alfresco db.
For example, at one of my clients I use an Apache Camel component to ingest audit records into Elasticsearch. That makes it easy to provide a nice front-end query tool that can report on login, logout, document create/read/update/delete, permission changes, and so on.
Hope that helps,