Is it against code to run electric Line in cpvc out of breaker panel and into the ground?
You have to use conduit listed and labeled for electrical use. So if you're thinking about using plumbing pipe, forget about it.

Since the conduit will be underground, it's considered a wet location. That means you'll have to  use wires that are allowed in wet locations. THWN is commonly used for this, though is likely advertised as THHN/THWN or THWN-2, or something similar.

Wherever you enter/exit the ground, you'll want to use an expansion fitting. This allows the conduit to expand and contract, as well as allowing the ground to heave and depress as soil conditions change.