Just to add to other answers:
You can estimate the length of a meridian arc over a spheric surface with the formulas provided by TomazicM.
Also, you can estimate the length of a parallel arc over a spheric surface multiplying the same formula by the cosine of the latitude.
If your points are not along a meridian or a parallel, as JoeBe answer, you can estimate the length of the great circle arc that pass through both points with the Haversine formula.
But let me say, don't calculate the distance. Estimate the coordinates of the points and let GeodSolve to estimate the distance over the ellipsoidal surface. Let me assure you that it is the best algorithm we have available, and that PROJ, QGIS, I imagine that PostGIS also, delegate to this library the calculation of their ellipsoidal distances.
For instance, between points
A = (-30° latitude, 113° longitude) and
B= (-38° latitude, 111° longitude) there is a distance (over the WGS 84 ellipsoid) of 906343.630 m. The indeterminacy in the distance is nothing compared to the indeterminacy in the coordinates.