A message is marked as read as soon as you open it AND then switch to another thread (or another folder). While reading, the unread styling stays in place so you can see what was new — just like Outlook does.
The count in the top right (around the mail icon in the sidebar) refreshes automatically every 60s, or immediately after your own action.