Due to prolonged pressure on the arm there is an obstruction of blood supply to the arm especially to the nerves of the arm. Also pressure is transmitted to the nerve directly also and causes the disturbance of its function. If pressure is taken off well in time the damage is not irreversible. But prolonged pressure during sleep can cause palsy
which can be permanent !!
It is advisable to get rid of this habit of sleeping over the arm. Once in a while many people experience this, but having it recurrently should be a warning for you to act before it is too late.