JavaScript:

function TreeDepth(pRoot, long = 0)
{
  if(!pRoot){
    return long
  }
  return Math.max(TreeDepth(pRoot.left, long+1), TreeDepth(pRoot.right, long+1))
}