That sounds like it could be that you're running out of memory.
Open the Activity Monitor, switch to the Memory tab, and watch the Memory Pressure graph as well as Memory Used. If memory pressure isn't green, or memory used is close to Physical Memory, you're using too much. In that state, the whole MacOS GUI can become rather unresponsive, fitting your description.