The only difference is that they are created in different regions of computer memory and heap based objects are persistent in such a way that they don't get deleted automatically as they have no scope. There are no general rules when to use which.