The context of this answer is 747-100 and -200 freighters at two airlines during the 1990s flying both civilian and military freight.
In the case of the 747-100 and -200 you had a 3-man cockpit crew: Captain, First Officer, and Flight Engineer. With the 3-man crew, there was no regulatory need to carry an additional pilot for a long flight. The 747-400 has, of course, a 2-man cockpit, but I don't know what the long-haul regulatory requirement was/is for an additional pilot.
There was no regulatory requirement to carry a loadmaster. If you were going between two stations that you regularly operated between, a loadmaster might not be carried if each station had trained loadmasters. However, if you were on a multi-leg, multi-day trip including stops where there wouldn't be loadmasters, one would be on-board (and maybe two if one of them was being trained). The loadmasters sometimes stayed with the airplane (or at least they used to) for periods of a few days to as much as two weeks even though the cockpit crews were changed out every day. Every few days the loadmasters would check into a close hotel for a quick shower or use a shower at an airport maintenance facility or some such. What always dismayed me was that they seemed to exist solely on catered food on the airplane for the entire time. While the airplane was in the air they slept when they weren't eating. Hopefully by now loadmasters are unionized and have better working conditions.
A mechanic was often carried if the airplane was having troubles or if it was being dispatched into Africa or other places where competent maintenance would not be available.
If you were carrying horses, there would be handlers with them. The one time I carried horses, they had a handler for each horse. Also, if you were carrying sensitive or very expensive cargo, there would often be someone to watch over it.
If it was a military cargo flight, there would sometimes be a 'military courier' or two aboard.
Jumpseaters were common, sometimes a lot of them depending on where you going, where you were coming from. The old 747s had 2 jumpseats in the cockpit and, typically, at least 8 first class seats on the upper deck, and often a bunk or two. I noticed in the accident report for the 747 freighter loss at Bagram that there were 7 persons aboard.