If your iPhone won’t turn off, you can force it off by holding the sleep/wake button and the home key down at the same time until the Apple Logo appears. This will reset your iPhone, but should make it power on and off normally after it resets.