Scientists have published a new article claiming conclusive evidence for Earth having a strong magnetic field 3.45 billion years ago. This is about 200 million years earlier than previous evidence seemed to support. It's my understanding there aren't many rocks much older than that, so (in my extremely expert opinion) it's a good bet Earth has had a strong magnetic field for as long as it could have one.