Weil was in Finland when World War II broke out; he had been traveling in Scandinavia since April 1939. His wife Éveline returned to France without him. Weil was mistakenly arrested in Finland at the outbreak of the Winter War on suspicion of spying; however, accounts of his life having been in danger were shown to be exaggerated.[8] Weil returned to France via Sweden and the United Kingdom, and was detained at Le Havre in January 1940. He was charged with failure to report for duty, and was imprisoned in Le Havre and then Rouen. It was in the military prison in Bonne-Nouvelle, a district of Rouen, from February to May, that Weil completed the work that made his reputation. He was tried on 3 May 1940. Sentenced to five years, he requested to be attached to a military unit instead, and was given the chance to join a regiment in Cherbourg. After the fall of France, he met up with his family in Marseille, where he arrived by sea. He then went to Clermont-Ferrand, where he managed to join his wife Éveline, who had been living in German-occupied France.

In January 1941, Weil and his family sailed from Marseille to New York. He spent the remainder of the war in the United States, where he was supported by the Rockefeller Foundation and the Guggenheim Foundation. For two years, he taught undergraduate mathematics at Lehigh University, where he was unappreciated, overworked and poorly paid, although he didn't have to worry about being drafted, unlike his American students. But, he hated Lehigh very much for their heavy teaching workload and he swore that he would never talk about "Lehigh" any more.[citation needed] He quit the job at Lehigh, and then he moved to Brazil and taught at the Universidade de São Paulo from 1945 to 1947, where he worked with Oscar Zariski. He then returned to the United States and taught at the University of Chicago from 1947 to 1958, before moving to the Institute for Advanced Study, where he would spend the remainder of his career. He was a Plenary Speaker at the ICM in 1950 in Cambridge, Massachusetts,[9] in 1954 in Amsterdam,[10] and in 1978 in Helsinki.[11] In 1979, Weil shared the second Wolf Prize in Mathematics with Jean Leray.

Weil introduced the adele ring[24] in the late 1930s, following Claude Chevalley's lead with the ideles, and gave a proof of the Riemann–Roch theorem with them (a version appeared in his Basic Number Theory in 1967).[25] His 'matrix divisor' (vector bundleavant la lettre) Riemann–Roch theorem from 1938 was a very early anticipation of later ideas such as moduli spaces of bundles. The Weil conjecture on Tamagawa numbers[26] proved resistant for many years. Eventually the adelic approach became basic in automorphic representation theory. He picked up another credited Weil conjecture, around 1967, which later under pressure from Serge Lang (resp. of Serre) became known as the Taniyama–Shimura conjecture (resp. Taniyama–Weil conjecture) based on a roughly formulated question of Taniyama at the 1955 Nikkō conference. His attitude towards conjectures was that one should not dignify a guess as a conjecture lightly, and in the Taniyama case, the evidence was only there after extensive computational work carried out from the late 1960s.[27]

Weil's ideas made an important contribution to the writings and seminars of Bourbaki, before and after World War II.

He says on page 114 of his autobiography that he was responsible for the null set symbol (Ø) and that it came from the Norwegian alphabet, which he alone among the Bourbaki group was familiar with.[30]

^I. Grattan-Guinness (2004). I. Grattan-Guinness, Bhuri Singh Yadav, ed. History of the Mathematical Sciences. Hindustan Book Agency. p. 63. ISBN9788185931456. Like in mathematics he would go directly to the teaching of the Masters. He read Vivekananda and was deeply impressed by Ramakrishna. He had affinity for Hinduism. Andre Weil was an agnostic but respected religions. He often teased me about reincarnation in which he did not believe. He told me he would like to be reincarnated as a cat. He would often impress me by readings in Buddhism.