As is true for any business deal, whatever the two parties agree on.
Some directors have worked for free. ($0)
Some directors have put in their own money to finish a picture and never got it back. (>$0)
For big budget Hollywood they might get an upfront bonus for signing on to the picture, a salary during production, a percentage of the box office or profits and some even get a perecentage of the memorabilia marketing. ($millons)
And everything in-between these extremes.