Instance variables exist inside objects on the heap. Therefore they are also on the heap.
Local variables exist only in the stack. They are not part of the structure of the object.
Static variables exist in the classfile structure that is created when the class is loaded.
However it is not a simple as that. Stacks hold frames (one frame per method) but the frames may be "heap allocated" so it gets sort of fuzzy. Technically the Method area may be heap allocated also (depending on who wrote the JVM).
For all practical purposes though, the
word "heap" is used to describe just the area that holds the objects and arrays.