There is a 240V/30A circuit in a room of my house that used to be a patio. I think it was used for a baseboard/electric heater system. It had a surface mounted outlet that I have removed, but now I have the cable sticking out of the wall. I also disconnected the wires completely from the breaker panel, so they're hanging by it. How much of this wire should I remove to be safe?
If the wire is completely disconnected from the panel, and you've confirmed with appropriate testers that there is no voltage running through it, the line is safe. You can cut it back as much or as little as you like.
I'd suggest that you cut it back on both ends - so that it cannot reach the panel and be hooked up again in the future by someone else who doesn't know better.