One expects that the majority of algebraic curves over number fields having genus $> 1$ should not be modular in this sense.

For instance, take a sufficiently general genus 2 curve $C$ over $\mathbf{Q}$. Then its $\ell$-adic $H^1$ (which is just the $\ell$-adic Tate module of its Jacobian) will be a 4-dimensional Galois representation whose image lands inside $\mathrm{GSp}_4(\mathbf{Z}_\ell)$. If $C$ is sufficiently generic, then the image of this Galois representation should be the whole of $\mathrm{GSp}_4(\mathbf{Z}_\ell)$ for all but finitely many $\ell$; in particular, it will be absolutely irreducible. (I don't know if this is known, but certainly one expects it to be the case.) On the other hand, if $C$ admits a non-constant map from $X_0(N)$, then the its $H^1$ would have to be a quotient of the $H^1$ of $X_0(N)$, and this can be calculated in terms of modular forms; in particular all its absolutely irreducible subquotients have dimension 2. So most genus 2 curves $C$ will not be modular in your sense, and if you get one that is, you should regard it as a rather unlikely coincidence.

(A more high-powered interpretation of this is that $H^1(C)$ should be the Galois representation attached to a degree 2 Siegel modular form. In some very special cases this Siegel modular form will be endoscopic, i.e. describable in terms of lifts from elliptic modular forms, but most Siegel mod forms will not be endoscopic and thus will not have anything to do with $X_0(N)$ for any $N$.)

If you're willing to relax your definition of "modular", though, you can get many more possibilities. There's a very striking result of Belyi stating that any algebraic curve defined over a number field can be obtained as the quotient of the upper half-plane by some subgroup of $PSL(2, \mathbf{Z})$, although the corresponding group will usually not be a congruence subgroup.