Which curves are boundary of pseudoholomorphic curves?

The 'moment conditions' that Ben McKay mentions are simply this: A closed curve $C$ in $\mathbb{C}^n$ bounds a compact Riemann surface (which might be singular) if and only if the integral around $C$ of any global holomorphic $1$-form on $\mathbb{C}^n$ vanishes.

One direction is just Stokes' Theorem: If $\omega$ is a holomorphic $1$-form, then $\mathrm{d}\omega$ is a holomorphic $2$-form, and a holomorphic $2$-form vanishes when pulled back to any (possibly singular) complex curve. Thus, if $C = \partial X$ where $X\subset\mathbb{C}^n$ is a compact Riemann surface (with boundary), then $\int_C\omega = \int_X\mathrm{d}\omega = 0$.

The converse, which (I think) is due to Harvey and Lawson (Boundaries of complex analytic varieties, I., Annals of Mathematics 102 (1975), 223–290), is rather deeper.

I don't remember whether there is a test for when $C$ bounds an actual holomorphic disk (i.e., a Riemann surface of genus $0$). I believe I remember that when $C$ does bound a compact (singular) holomorphic Riemann surface, it bounds only one. (I don't have access to the Harvey-Lawson paper I cited just now. If you want the definitive statment, I suggest that you check that paper.)