This is a minimisation problem on a graph
From your description, you have a set of stars which are connected by an arbitrary network of wormholes, each of which can be assigned some 'distance'. You want a two-dimensional representation of this universe (i.e. a map) which is close to accurately representing the distances.
The natural way to draw this map is as a graph, which is a set of nodes (your stars) connected by edges (your wormholes). When turning this into a map, usually a subway-style map is created, because train networks are very similar in being a set of nodes (stations) connected by edges (train lines). This point is covered in Nuclear Wang's and Renan's answers.
If you only need a single map created manually and you only require the distances to be approximately accurate, you could do this by hand (employing appropriate graph-drawing software to make the task easier, so you can drag around nodes until everything looks right, or better yet have it automatically place the nodes). A benefit of doing it by hand is that you can handle outliers in an intuitive manner (e.g. if you have shortcuts which cut through an otherwise well-behaved network of wormholes).
If the location of the stars can be mapped to regular space and the distance of the wormholes is simply proportional to distance, it would be easiest drawing the stars where they are in real space. This is simple and intuitive, although requires either compromise or creativity if there is a significant 3D component.
For the generic problem, where you have an arbitrary collection of stars connected in an arbitrary manner by wormholes of arbitrary length, your task becomes an optimisation problem in representing this graph. You may need to be able to construct this graph automatically (such as for randomly generated maps). For this we invoke some mathematics. Details of implementing such algorithms are beyond the scope of this site and should be asked elsewhere.
We have a set of distances $\{r_{ij}\}$ between stars, where $r_{ij}$ is the distance between stars $i$ and $j$. Your list of distances might only include explicit wormhole connections. Or you might like to include all pair-wise distances (so that the distances in your map are accurate even for stars not directly connected), in which case you would need to step through your graph one node at a time, building up distance matrix.
(If the 'true' distances between two stars needs to be referred to often, you probably want to keep this distance matrix for use throughout the game and rely on it rather than checking points on the map.)
We want to find the coordinates $\{(x_i,y_i)\}$ of each of the stars in two-dimensional Euclidean space (that is, we want to determine where on the screen to draw them). And we want to find them in such a manner that minimises (in some way) the difference between the desired distance $r_{ij}$ and the drawn distance $\sqrt{(x_i-x_j)^2 + (y_i-y_j)^2}$.
Perhaps the simplest way (but not the only way) to frame this minimisation problem is with non-linear least squares. We can avoid awkward square roots by squaring the distances. Then we can minimise the sum of the squares of the differences between the target and actual distances,
$$
S = \sum_{\{(i,j)\}} \left( (x_i-x_j)^2 + (y_i-y_j)^2 - r_{ij}^2 \right)^2,
$$
where the sum is taken over pairs of $i$ and $j$ for which you have defined $r_{ij}$. We then minimise $S$ with respect to $\{(x_i,y_i)\}$. How you do this is beyond the scope of this question, although it is a well-studied problem and there are places elsewhere on the Stack Exchange network which will answer how to do this.
Once you have the coordinates $\{(x_i,y_i)\}$, you then get the computer to draw your stars at those points then draw wormholes between the appropriate stars.
You can add extra sophistication to $S$. For instance, you may consider that the more wormhole jumps there are between two stars the less important it is for the distance to be very accurate, so you might apply a weight to each term in the sum to indicate their relative importance. Or you might like to avoid drawing wormholes crossing each other, in which case you can add a penalty function which increases $S$ if two wormholes cross.
While you could write your own code from scratch to draw your star map, graph visualisation is an old problem. There already exists many graph drawing software packages which handles a lot of the problems of creating aesthetically pleasing graphs. You will have to check which ones suit you, since some may not handle hundreds of nodes and some require you to pay. You also want to be able to take the output from the graph visualisation software and insert it into your game graphics engine. Although I have not tried it, a cursory glance through search results indicates that graphviz might be appropriate, since it is open source and implements algorithms which optimise the graph layout for the types of graphs you want. But check yourself if it meets your needs.
Note that, in general, it will not be possible to get the distances on the map to perfectly align to the 'real' distances. If your graph is very complicated, then it might not be possible to get even close to an accurate representation. There are two solutions here. One is to discard the old arbitrary wormhole lengths and instead re-write the wormholes to have a length equal to their length on the map. The other is to write the wormhole lengths as numbers on the map (as in Renan's answer); the people (or computer) reading the map can accept that scale is approximate but rely on the written numbers being exact.
You also ask about how people would represent these maps in-universe.
If the arrangement of wormholes is not expected to change during the lifetime of the map, then the map would likely be created in a similar manner to what I have described above. Software exists for converting graphs into pictures, and depending on the purpose and size of the map it can be partially or wholly designed manually.
Such maps are useful for transportation and travel, like our subway maps. Train lines rarely change, so the map does not have to be updated too often. Train lines also correspond to physical space, so when a new train line is added the map only has to change a little bit to accommodate the new train line.
These maps would also have military applications. Logistics is a big part of war. You want to be able to see what territory each faction controls, how spread out it is, how far it is from your own, how long it would take to get between two points, etc. While quantitatively accurate results will require calculations, a well-designed map will allow for the essential data to be intuitively grasped. For a well-behaved graph, the distances on the map may even be decent approximations for the fully accurate numbers.
You mention in a comment that the wormholes do not change throughout the course of a game. This means the aforementioned map is useful.
However, there is likely a timescale on which wormholes are created or destroyed or moved. Unless the 'distance' of a wormhole is roughly proportional to the real-space distance, creating new wormholes is likely to radically alter and invalidate a graph-based map.
Astronomical and surveyor maps will be of this type which must remain relatively unchanged despite the layout of wormholes. Such maps will try to represent the positions of stars in real space. Wormholes will be drawn as lines between stars without respecting the 'length' of the wormhole. How to draw points in 3D space on a 2D map is its own problem. The data of star positions would be stored as a list of 3D points and it will be up to each mapper to determine how to project that data onto 2D (such as Retracted's answer). Or they could use 3D graphics, holograms, virtual reality or augmented reality to display the data in 3D.