Definition of the gum ridge are a ridge that forms the borders of the upper and lower jaws and contains the sockets of the teeth .