By the title, I mean how many parents can an object have before the parent equals the parameter for it to return true?
wiki says, "An Instance is considered the descendant of an object if the Instance's parent or one of its parent’s parent is set to the object."
Does this mean IsDescendantOf will return true for only the parent or the parent's parent as the parameter? what about the parent's parent's parent and so on?
IsDescendantOf is, in theory, infinite. So yes, the function accounts for any place in the parent hierarchy no matter how distantly related.