Data from a raster layer can be added to a points layer by querying the value of the layer in the coordinates of the points. This process is known as sampling, and this recipe explains how to perform it.
A new vector layer will be created. This contains the same points as the input layer, but the attribute table will have an additional field with the name of the selected raster layer and the values corresponding to this layer in each point:

The coordinates of the points are taken, and the value of the pixel in which the layer falls is added to the resulting points layer.
This method assumes that the value of a cell is constant in all the area covered by this cell. A different approach is to consider that the value of the cell represents its value only in the center of the cell and perform additional calculations to compute the value at the exact sampling point using the values of the surrounding cells as well. This can be done using several different interpolation methods, which can be selected in the Interpolation method selector, changing the default value, which only uses the value of the cell where the sampling point falls.
Layers are assumed to be in the same CRS and no reprojection is performed. If this is not the case, the value added to the vector layer might not be correct.
Here, you can find some ideas about how to combine a raster and vector layer in different situations.
Data coming from a raster layer can also be added to other types of vector layers. In the case of a vector layer with polygons, the Grid statistics for polygons algorithm can be used, as follows:
watershed.shp file that we used in the previous recipe.The resulting layer is a new polygon layer with the watershed and an additional field in the attributes table, containing the mean elevation value for each polygon.
If more statistics are selected, the result will have a larger number of additional fields added, one for each new parameter computed and each selected grid.