To construct a cyclic cover of degree $n$ over a scheme $X$ you need a line bundle $L$ with a (non-zero) morphism $f : L^n \to O_X$. Indeed, the covering can be defined as $$ Y = Spec_X(O_X \oplus L \oplus \dots \oplus L^{n-1}) $$ with the ring structure induced by the map $f$. The branch divisor of the covering $Y \to X$ is given by the equation $f = 0$.
Applying this construction in case $X = C$, with $L$ being the ideal of a point $P \in C$, and $f$ being the section of $L^{-n}$ corresponding to the divisor $nP$, one obtains a covering $Y \to C$ that is branched only over $P$.