When playing an acoustic piano it is bad to leave a key depressed as it can damage the piano in several ways. Is it the same with an electric/digital piano/keyboard? Whether they are on or off I’d like to know either way, please.
It isn't bad to leave a key depressed. You hold a key down as long as you want the note to sound. Let it up and the damper will stop the note ringing. You could store a piano with all the keys held down and no harm would be done (though I don't know why you'd want to).
There's an additional element on many electric keyboards, the ones that go beyond just being an imitation piano. They might have 'aftertouch', where continuing pressure is used as a controller, typically routed to vibrato or pitchbend. Again, hold the key down as long as you want to use this feature. I suppose storing the keyboard under pressure might wear out the contact strip.