I am essentially just repeating Will's answer, but giving a slightly different point-of-view (and a relevant reference).
Let $F_r$ be a free group of rank $r>1$. Given a discrete faithful representation $\rho:F_r\to \mathrm{PSL}(2,\mathbb{R})$ it is torsion-free and so $\mathbb{H}^2/\Gamma$ is a complete hyperbolic surface $\Sigma_\Gamma$, where $\Gamma:=\rho(F_r)$. You asked how to determine the homoeomorphismhomeomorphism type of $\Sigma_\Gamma$.
In general, you need to know the gluing data for the fundamental domain. For this, it suffices to know simple closed curves around each boundary and puncture (which tells you $n+b$). For then, using $r=2g+n+b-1$ you can determine $g$.
Around each collar neighborhood of a boundary, the holonomy $\rho$ must correspond to a translation (which determines a geodesic length) and so its absolute trace will be $>2$. Around each puncture the holonomy of the corresponding loop must be a horolation (rotation at infinity) and so its absolute trace must be 2. So from the traces you can determine which loops are at punctures and which are at boundaries.
I recommend reading concrete examples in Trace Coordinates on Fricke spaces of some simple hyperbolic surfaces by William M. Goldman. See Section 4, in particular.