algorithm that openGL uses to construct 3D surface from vertices
Most 3D models are not just collections of points; they’re also the information about how those points are connected. Those are polygon meshes. What you’re describing sounds like a point cloud, which is what processes like 3D scanning often produce. That article has a “conversion to 3D surfaces” section; if you search for “point cloud meshing” elsewhere you should also find a bunch of information about ways to do this. One new-ish technique worth looking at, which is more robust than a lot of older approaches to the problem: Fast Winding Numbers for Soups and Clouds.
For OBJ files in particular, polygons are specified with a list of vertices using the f command as described here.