A cockroach can usually live for about 7 to 10 days without water, and can go for at least 30 days with no food before it starves.
It is almost impossible for cockroach to starve to death in the wild unless it is enclosed or trapped, because of its uncanny ability to eat almost anything as a food source.
If no natural food sources are available, a cockroach will eat virtually any organic substance available including upholstery, cardboard, glue, etc. Virtually any plant or animal-based substance can be consumed and eaten by a roach.
If you would put a roach inside of a box or other enclosure to test how long it would live before it starved to death, it would usually live for about a month without any food.