Plants can survive without sunlight as long as they have another source of light in the appropriate spectrum, such as an artificial grow light. Plants can only survive in complete darkness for a finite period of time. Generally, plants that are in vegetative phases thrive on blue lights, while plants in flowering phases thrive on red and orange lights.
Plants need sunlight or another form of light in a similar portion of the electromagnetic spectrum, because they convert light energy along with water and carbon dioxide during photosynthesis into chemical energy in the form of glucose. They can survive in darkness for short periods of time using these sugars in a manner analogous to a human surviving without food by subsisting on fat stores.