Although the "heap is slower" statement is too broad to be meaningful, certain aspects associated with heap allocations are definitely slower than the heap. Unlike stack, which cannot get fragmented because you cannot remove things from the middle of the stack, heap is subject to fragmentation. Your program can de-allocate objects in arbitrary order, creating "holes" in the heap. When you request more memory, the allocator must search for a suitable "hole" to fulfill your request.
In addition, stack-based operations are highly optimized by the computer hardware. Finally, objects allocated in the automatic storage (the official name for "stack") have a higher probability of being cached due to proximity to other locals that your program accesses.
As far as static
storage goes, it applies only to data members: static functions and static member functions simply re-use the keyword without re-using its meaning. Objects in static storage are allocated only once, so there is no cause for fragmentation.
Once the allocation is done, the speed of access to the objects in the three kinds of storage (static, dynamic, and automatic) goes at pretty much the same speed.