iMac boots quickly but takes loooong time to log into account
I've seen this before, but it could be a number of things. My suspicion is something in your Login Items is using a lot of CPU/Disk/Network thus delaying everything else.

To further diagnose run System Preferences from the Apple menu and choose Users &amp; Groups and create another account with any name you like. Log out, then log in to that account. Note how long it takes. If this is significantly faster, it's a user account issue for your primary user account, rather than a machine issue.

Machine Issue


Look in Activity Monitor in the Energy tab. This will show any applications that are using, or have recently used, a lot of resources. Sort by Avg Energy Impact. Anything obviously using more energy than everything else at the top of the list?
Run Anti-Virus scan; Clam XAV is in the App Store and free. Other free options are downloadable. Did it find any malware?
As an Administrator (if you're not already), run the Console app and enable 'Activities'. Does the console fill up with busy work? Anything dominating the output more than others?
See also:
speedup macOS Sierra startup, Troubleshooting Slugglish Post-desktop Startup


User Account Issue:


Run System Preferences: Users &amp; Groups. Choose your user account in the top-left corner (if not already selected) and then click Login Items. Do you recognise all of the items? Please note them down for later review. Some are system-provided (e.g. SpeechSynthesisServer) but IIRC it's okay to remove them all if you're unsure. Try this then reboot - did it make a difference?
See also: Troubleshooting Slugglish Post-desktop Startup