When we raise a defect from the run window while running a test case, it is automatically linked to the test case. But, a user may raise a defect directly from defects tab and then link it to the required test case.
Below image shows (column) circled in blue oval) defects which are linked to a test case and defects which are not linked to any test case.
Now, to link a defect, navigate to the test lab tab and open the required test case by double clicking it.
Click on Linked defects tab.
Click on by id as shown above. A popup asking to enter the defect id to be linked to the test case will be shown. Enter the defect id and click Link.