This category is not unique, but it is unique up to isomorphism. So this definition is ambiguous in the same totally harmless sense as saying “the trivial group is the group with one element.” Indeed, any two one-element sets $(X,Y)$ give an example of $\mathbf 1$ in a unique way, once one set is chosen to contain the object and the other, the morphism.
It's a mistake (or at least imprecise) to say a monoid is a category with 1 element. But there is a canonical equivalence between monoids and 1-element (small) categories.
Recall that a monoid consists of a set $M$, together with a binary operation $\cdot$ and an element $e$, which satisfies the three equational laws $x \cdot e = x$, $e \cdot x = x$ and $(x \cdot y) \cdot z = x \cdot (y \cdot z)$.
Let's immediately note that for any (locally small) category $C$ and any object $A \in C$, there is a monoid structure on $Hom_C(A, A)$. The composition law is $\cdot = \circ$, and the identity is $e = 1_A$. So categories are filled with monoids. Call this monoid $M_{C, A}$.
On the other hand, for any monoid $M$, consider the category $C_M$ with one object $\star$, and with $Hom_{C_M}(\star, \star) = M$, with $1_\star = e$, and with $a \circ b = a \cdot b$ for all $a, b \in Hom_{C_M}(\star, \star) = M$. It's easy to verify the category laws on $C$ - they are just the three laws of the monoid.
And of course, you get that
$$M_{C_M, \star} = M$$
by definition. Furthermore, for any 1-element category $C$ where the 1-element is $\star$, you have
$$C = C_{M_{C, \star}}$$
again by definition.
This means that any theorem you can prove about all categories can be specialised to the case of 1-element categories, which can then become a theorem about monoids.
This is not to say that we "need" to represent monoids in this way. But it is a very helpful way to represent monoids.
Another way of taking a monoid $M$ and producing a category from it is considering the category $D_M$ where the objects are elements $m \in M$, and $Hom_{D_M}(n, m) = \{j \mid j \cdot n = m\}$, with the composition law being $\cdot$. It turns out that this representation can be obtained from the 1-element category representation $C_M$ using two general categorical constructions - the Yoneda functor and the "category of elements" - which you probably haven't learned about yet. So there isn't really a good reason to use this representation as far as I know.
Best Answer
A graph can be defined as a pair of functions $s,t:E\to V$, where the elements of the sets $E,V$ are referred to as 'edges' and 'vertices', and $s$ selects the 'source' and $t$ the 'target' of an edge $e\in E$.
In the free category, composition is defined formally, so that we will have an arrow for every word (finite sequence) of the given edges.
In general, the morphisms of the free category generated by a graph are exactly the paths of the graph (including paths of zero length for the identities).
Note also that if a category has only one object, it is basically a monoid, as any two arrows can be composed, and thus the exercise is to find the free monoid on 26 generators.