The relationship is roughly this:
Maximum recursion depth = ((Stack size) - (Total size of stack frames in call chain up to the recursive function)) / (Stack frame size of recursive function)
The stack frame is the data that gets pushed onto the stack each time you make a function call. It consists of the function return address, space for parameters (that weren't passed in registers) and space for the local variables. It will differ for different functions but it will be constant for a given function recursively calling itself at each call.
It follows from this that a recursive function with a large number of parameters and/or large number of local variables will have a larger stack frame size, and therefore a smaller maximum recursion depth for a stack of a given size.
If the compiler performs tail recursion optimization, then the stack frame size is effectively zero after the top-level call, so the formula gives a divide by zero: no max recursion depth.
Everything I've said here probably has multiple exceptions to the rule, but this is the basic relationship.