300V DC can be switched with a power MOSFET (advisable \[V_{DSmax} > 400\,V\]) or with an IGBT. Specific drivers are available for both. However, since your application does not suffer a performance penalty when using a low side switch, I'd go for an N channel MOSFET and drive it with an opamp at 12V set up as a comparator with positive feedback (hysteresis) that compares either the panel output voltage or an input from a dedicated light sensor against a trimpot to set the cut-off luminosity.