In the expression "a prime-square", the hyphenated word is a noun, whereas in "a prime-squared number" the hyphenated word is an adjective. Both are correct in the context they're being used for.
Thus it would be correct to say:
A prime-square is also called a prime-squared number and refers to a prime number that has been squared. Similarly, a prime that has been cubed is a prime-cube.
However, the above is an example of correct grammar rather than preferred usage. The terms themselves don't seem to be very common: Google Ngram Viewer returned a null result for each of the hyphenated forms. A broader search through Google Books shows mixed results, but it seems that the unhyphenated expressions are also used: this book uses both prime squared and a prime squared number.