iPhone auto-power-off after power disconnection
Without jailbreaking, this is not possible as Apple does not provide a feature for this, and apps can't control the system in this manner.

If the device is jailbroken, you can use an Activator action to Power Down on Disconnect.