My check engine light was on. After my car set over the weekend it wouldn't start. I took the battery down to a shop to be checked and charged. When I picked it up they said I needed to replace it. When I put the new battery in the car, the check light was off. How long before the check light could go back on if it was something else causing a problem.
More than likely it would show up right away. If it was on before, and now it's off, I'd say the problem's fixed. The codes for what ever triggered the CEL would no longer be present due to the lack of battery power, so you cannot just do a scan on the vehicle. You can, however, check to ensure that battery voltage at rest and while the engine is running are ~12.5+vdc and ~14.1-14.5vdc respectively. If the alternator is producing under that or if you see the voltage ticking slowly down, it could very we'll be there is an alternator problem. I doubt it, but it's worth checking.