Rubber consists of long chains of molecules tangled up like random pieces of string (below left).
When you stretch rubber (above right), for the most part you do not make the molecules longer. You straighten out the molecules and align them more nearly in the same direction. Rubber is a very stretchy material. It can be stretched much more than steel for example, and can be used to store energy as the elastic potential energy of stretching. If a rubber band is stretched however, not all the energy used to stretch the rubber can be recovered when the stretching force is removed. This is shown below in a graph of force against extension.
There will be a net energy loss, equal to the area between the loading and unloading curves. This energy appears as heat energy in the rubber.