Prim's time complexity is with a binary heap, where is edges and is nodes. You push each edge once and pop at most times from the heap. With a Fibonacci heap, Prim runs in , which is better for dense graphs.
But binary heaps are simpler and usually fast enough. For sparse graphs (), Prim and Kruskal have similar performance. For dense graphs (), Prim can be faster.
Space complexity is for the data structures used.