It's dependent upon both. Actually, it's quite a complex issue, as it also relates to the distance from the camera. In general:

smaller aperture means greater depth of field

shorter focal...