A cockroach could live a long time, perhaps a month, without its head. The only reason we need our head for basic survival is:
(1) We breath through our mouth or nose and the breathing rhythm is controlled in our brain. Cutting off our head would interphere with breathing although that could be maintained with a respirator.
(2) Cutting off our head could lead to blood loss and a drop in blood pressure which would result in death due to lack of blood transport of oxygen and nutrition to our tissues.
(3) Cutting off our head would prevent us from eating and we would die of starvation pretty quickly.
All of these reasons for dying are not present in cockroaches and many insects in general:
(1) Cockroaches breath through spiracles which are in each body segment and the blood does not carry oxygen to the tissues. The spiracles deliver air to each cell of the body through a set of tubes called tracheae. The brain does not control the breathing through the spiracles.
(2) The cockroach does not have blood pressure the way a mammal does and so cutting off the head does not lead to uncontrolled bleeding.
(3) The cockroach is a poikilotherm or cold blooded animal. They need much less food and a one day meal would be enough to last them a whole month as long as they were not extremely active. Without a head the cockroach would just sit around without doing anything much.
All this along with a cool temperature could allow the cockroach to last about a month without need for their head, as long as they did not get infected with a mold, bacterium or virus, which could kill them prematurely.