Like the Jon said, there is an algorithm named Snap geometries to layer in QGIS 3 processing toolbox.
However, you have to pay attention to the options in the Behavior parameter. There are 8 options for the parameter. I've looked at the script code and the first 7 first parameters are related to the enumeration SnapMode present in the class QgsGeometrySnapper. The last one is related to QgsGeometrySnapperSingleSource, but it applies only when using a single layer, i.e., the input and the reference layer are the same.
Note that many options start with Prefer, e.g., the first option, Prefer aligning nodes, insert extra vertices where required, will prefer to snap to the nodes of the reference layer, but in case there aren't any nodes to snap, it will snap to the segments. The part of inserting vertices is, in case the input layer has a line or polygon type, it will insert vertices in order to make the input geometries match along the reference geometries. This isn't the case here, where you want to snap the input point layer to the reference line layer.
From the picture, I suppose you want to snap the points to line intersections that occur at the end points of the lines. So I think the best option is to choose Snap end points to end points only with a tolerance a little bit higher than 1 meter. With this option, if the point can't be snapped to a line end point, it won't be snapped to another place.