New answer in light of edited question:
Namely, the added note suggests that we can actually input a pile count differing from 4 piles. The general "piles greater than all piles that follow it" rule still applies, however.
We can do much better now:
For instance, if we just limit ourselves to $x$ 2-piles and $y$ 1-piles, we can attain $xy$ gold at the costs of $2x+y$ stones. This is maximized when $x = 8$ and $y = 17$, for a whopping $136$ gold! (For this, we may use AM-GM, using a third variable $2y' = y$, which implies that the maximum product is attained when $x = y'$. Integer considerations prevent us from actually attaining this, however.) But can we do better if we also use 3-piles? Let us see.
.
Suppose we have $x$ >3-piles, $y$ 2-piles, and $z$ 1-pile. Then our current gold gain would be $xy+xz+yz$. In fact, let's be generous, and add $\frac{x(x-1)}{2}$ gold, assuming the 3-piles also give gold to each other. But if we converted all of our 3-piles into 2-piles and 1-piles equally, then we would instead have $y+x$ 2-piles and $z+x$ 1-piles, which would give us $xy+xz+yz+x^2$ gold. And since $x^2 > \frac{x(x-1)}2$, it follows that we should not have any piles that are greater than size 2.
Second question:
You can win any number of golds, given arbitrarily many stones. For instance, input $1$ 2-pile and $x$ 1-piles and you can get $x$ gold from $x+2$ stones for any positive integer $x$.
Old solution underneath:
I believe that the rule is:
It spits out a number of gold pieces equal to the number of pairs of piles that have a different number of stones. (Perhaps the piles should be decreasing, too, but I don't have evidence to the contrary.)
With this in mind:
First, we should figure out the optimal configurations to get gold. We can observe that the difference between successive piles must be at most 1.
$4,3,2,1$ -> 6 gold / 10 stones (optimal 1,1,1,1 split)
$3,2,1,1$ -> 5 gold / 7 stones (optimal 2,1,1 split)
$2,2,1,1$ -> 4 gold / 6 stones (optimal 2,2 split)
$2,1,1,1$ -> 3 gold / 5 stones (optimal 3,1 split)
$1,1,1,1$ -> 0 gold / 4 stones (optimal 4 split, but why would you do this)
From here, we can observe that one should never take the first option (you may as well take two option 4s) or the fifth option. The remaining options have the property that you "lose" $2$ gold per transaction. So it suggests that we should try to get rid of our $33$ stones in the fewest transactions possible. We can do this in $5$ transactions (for instance, $7+7+7+7+5$) but $4$ is impossible as $4\times7 = 28 < 33$. Hence we will lose 10 gold, and therefore be able to attain $33 - 10 = 23$ gold. (To answer the question, you can't attain $24$ gold, for instance. Unless it means from any amount of stones, for which we can use Froebinus to conclude that the only impossible gold values are $1,2$.)