This is a complement to Joe Silverman's answer and is a bit long for a comment. One seeks to find a $\mathbb{Q}$-curve $E$ so that $\mathbb{Q}(j(E))$ is a quadratic extension of $\mathbb{Q}$. One such $\mathbb{Q}$-curve is $E : y^{2} + \sqrt{2} xy + y = x^{3} + x^{2} + (-2\sqrt{2} - 3) x + \sqrt{2} + 1$, which has CM by $\mathbb{Z}[\sqrt{-6}]$. Moreover, according to the LMFDB database of genus 2 curves, if $C : y^{2} + x^{3} y = x^{3} + 2$, then the Jacobian of $C$ is isogenous to the square of $E$. Is it true that the Jacobian of $C$ is isomorphic to this product? Apparently, Shioda and Mitani proved that if an abelian surface is isogenous to a product of two isogenous elliptic curves with CM, then it is isomorphic to a product of two elliptic curves (which must be isogenous and have CM, necessarily).

Note: I don't think one needs to have a $\mathbb{Q}$-curve whose $j$-invariant is defined over a quadratic extension. Another example is $C : y^{2} = x^{5} - x$ whose Jacobian decomposes as the square of a $\mathbb{Q}$-curve defined over $\mathbb{Q}(\sqrt{2})$ which is not a base change from $\mathbb{Q}$, but whose $j$-invariant is $8000$.