James Potter was quite rich and Harry inherited it. According to the Dursleys though he "didn't work... he was unemployed". How did he get the money?
The wizarding family of Potters descends from the twelfth-century wizard Linfred of Stinchcombe, a locally well-beloved and eccentric man, whose nickname, ‘the Potterer’, became corrupted in time to ‘Potter’. Linfred was a vague and absent-minded fellow whose Muggle neighbours often called upon his medicinal services. None of them realised that Linfred’s wonderful cures for pox and ague were magical; they all thought him a harmless and lovable old chap, pottering about in his garden with all his funny plants. His reputation as a well-meaning eccentric served Linfred well, for behind closed doors he was able to continue the series of experiments that laid the foundation of the Potter family’s fortune. Historians credit Linfred as the originator of a number of remedies that evolved into potions still used to this day, including Skele-gro and Pepperup Potion. His sales of such cures to fellow witches and wizards enabled him to leave a significant pile of gold to each of his seven children upon his death.
Later on in the article:
The Potters continued to marry their neighbours, occasionally Muggles, and to live in the West of England, for several generations, each one adding to the family coffers by their hard work.
...Fleamont Potter... It was Fleamont who took the family gold and quadrupled it, by creating magical Sleekeazy’s Hair Potion ( ‘two drops tames even the most bothersome barnet’ ). He sold the company at a vast profit when he retired.
Fleamont Potter was James Potter's father.