In X-Men: Apocalypse, Apocalypse (En Sabah Nur) gives Magneto his helmet. In X-Men: First Class, Magneto gets his helmet from Sebastian Shaw.
Are these two movies in the different universe or does Magneto have two helmets?
The events of First Class and Apocalypse are in the same timeline / universe. There is no contradiction here. After the events of Days of Future Past, Magneto gives up his mutant life and the Magneto persona to raise a family in Poland and work an honest job. We don't know exactly what happened to his first helmet in the intervening time. After
the death of his new family,
he accepts the invitation to join Apocalypse's cause. Apocalypse demonstrates an exceptional control over matter, and we see him fabricating intricate suits for his Four Horsemen with ease using only his mutant powers. Apocalypse fashions Magneto's new helmet in a similar way, literally out of dust.
Anecdotally, I have two identical copies of the same baseball cap and, as far as I know, all the moments of my life have occurred within a single cinematic universe.
We actually see at least five different helmet designs within the x-men-cinematic-universe, including at least two physically different helmets.
Chronologically, the first one he has is the one he takes from Shaw in X-Men: First Class. Shaw received the helmet from the Russians.
At the end of the movie, he has repainted it, and added some flair. (Note: I am not counting this in my five-count)
Eleven years later, during the past events of Days of Future Past, Magneto's helmet looks different. Whether or not this is the same helmet, modified again, is unclear.
During the events of X-Men: Apocalypse, Apocalypse provides Magneto with a new helmet, seemingly "made" of sand. This appears to be a physically new helmet. The helmet is again, a dramatically different design.
Exactly what happened to his helmet between Days of Future Past and Apocalypse is unclear, but Erik has attempted to abandon his old life and ways. Discarding or even destroying his old helmet doesn't seem out of the question.
Some 20 years later, Magneto is seen with a very different helmet design. We see Toad painting it from a dull grey to purple, but it's unclear if this was a new helmet (from the DoFP era, since Apocalypse never occurred in this timeline) or a modified one.
In The Last Stand, he has a different design again. It's similar to the one from X-Men, with more contours and more hard edges.