He was a legend for sure even before winning the world cup, however we must also admit that in the eyes of many fans winning world cup is the biggest achievement a soccer player can achieve, and this was often used by the detractors of Messi against him, this was for example not used against Ronaldo as we knew that he was basically alone and his chances of doing so were low, but Messi is Argentinian, a country were soccer stars are worshiped as saints so in the eyes of many fans Messi really needed that win to solidify his position as one of the best ever, a thing he did already.
I never liked this approach by people to say that only when you win the World Cup you can become a legend. What are you going to do when you become one of the best players in the world but you are born in Iceland or Luxembourg? I have nothing to say against those countries, both are great countries, but in regards to soccer it is quite apparent that they will never win a World Cup. But does that automatically mean that never in the future a player from those countries can become an exceptional player who outcompetes everyone else in all other competitions?
The World Cup is still an important event with a lot of meaning, but Messi is the best example. How can someone say that Messi would not have been legend, had he not won the World Cup?