Flagg was born in Pelham Manor, New York. He was enthusiastic about drawing from a young age, and had illustrations accepted by national magazines by the age of 12 years. By 14 he was a contributing artist for Life magazine, and the following year was on the staff of another magazine, Judge. From 1894 through 1898, he attended the Art Students League of New York. He studied fine art in London and Paris from 1898–1900, after which he returned to the United States, where he produced countless illustrations for books, magazine covers, political and humorous cartoons, advertising, and spot drawings. Among his creations was a comic strip that appeared regularly in Judge from 1903 until 1907, about a tramp character titled Nervy Nat.
His most famous poster was created in 1917 to encourage recruitment in the United States Army during World War I. It showed Uncle Sam pointing at the viewer (inspired by a British recruitment poster showing Lord Kitchener in a similar pose) with the caption "I Want YOU for U.S. Army". Over four million copies of the poster were printed during World War I, and it was revived for World War II. Flagg used his own face for that of Uncle Sam (adding age and the white goatee), he said later, simply to avoid the trouble of arranging for a model.
At his peak, Flagg was reported to have been the highest paid magazine illustrator in America. In 1946 Flagg published his autobiography, Roses and Buckshot.
James Montgomery Flagg died in New York City and was interred at Woodlawn Cemetery.