In Great Expectations, Magwitch's report in Chapter 39 of having been
"I've been a sheep-farmer, stock-breeder, and other trades besides, away in the new world....many a thousand mile of stormy weather from this"
refers to New South Wales, which Pip learns from Mr. Jaggers in Chapter 50:
"I have been informed by a person named Abel Magwitch , that he is the benefactor so long unknown to me."
"That is the man." said Mr. Jaggers," --in New South Wales.
New South Wales included New Zealand at the time of the writing of Dickens's novel. Since this area was a penal colony for the British, it is likely that Magwitch was sent off after his capture by the officers on the marsh. There he was allowed to become a sheep rancher, which explains how he has amassed a great deal of money.
Because he is a yet a prisoner in New South Wales, he is confined to this colony. Leaving it constitutes escape and makes Magwitch subject to the death penalty.
In chapter 39, Magwitch approaches Pip and reveals that he was in fact his benefactor. Pip is too stunned at first to believe it, but Magwitch lets him know that he has been working very hard in order to save up money for Pip to become a "gentleman." Magwitch says that he had been "many a thousand mile of stormy water off from this" making his fortune; he also mentions a "new world." From this we can possibly assume that he was in America, or some other fairly new nation or country. He then says that he had made money being a "sheep-farmer, stock-breeder, other trades besides." He confesses later that he had a hard, rough time of it, all so that Pip could have an easy time of it. He also says he had a bit of luck, maybe with risky ventures or investments.
In returning to London, he faced a death sentence. He had been sentenced to death if he were to ever be spotted or found in England, and so in returning, he was possibly sacrificing his own life. But, his love for Pip was strong, and he wanted to see how Pip had turned out. I hope that those thoughts helped; good luck!
Magwitch earned his fortune by sheep-farming, stock-breeding, and other trades in the new world.
Magwich has earned money by joining some business and all this was for Pip as he considered Pip as his son
This was all well but then he decided to visit Pip and this created problems such as the police catching him as he was a famous criminal, if he was seen or somebody knew he was there then he would have been hanged!
(which he may have)