(I am not really sure about what tags I should give to this question, so I put every tag with 'topology' in it.)
We can write a torus as a cartesian product of two circles:
$T^2=S^1×S^1$
And the same way, a cylinder can be thought of as a cartesian product of a line and a circle:
If we denote $C^2$ as a cylinder and $L^1$ as a line, then:
$C^2=L^1×S^1$
So it seems like a factorization of shapes. So I want to know that
$(1)$Is there a mathematical concept like this?
$(2)$Are there prime shapes which cannot be written as a cartesian product of two shapes?
(I am extremely sorry of this question lacks mathematical clarification, I am not a mathematician so I cannot really clarify more than I did in my question. But I hope that the examples I gave, clarifies enough for someone to answer my question.)
First of all, instead of the word "shape" I will use topological space. Let's say that a topological space $Z$ is prime if whenever it is homeomorphic to the product $X\times Y$ of two topological spaces, either $X$ or $Y$ is a singleton.
Remark. I do not think there is a standard terminology here. The word prime is normally used in geometric topology to denote indecomposable manifolds with respect to the connected sum decomposition. For the purpose of this answer, I will disregard this notion from the manifold topology.
There were several posts on MSE regarding prime topological spaces, for instance here and here.
In particular, the real line ${\mathbb R}$ (with the standard topology) is prime, and so is the $n$-dimensional sphere $S^n$ for every $n\ge 0$. (The given proof of primeness of sphere assumes a decomposition as a product of CW complexes but the same argument using the Kunneth formula works in general if one works with the Chech cohomology.) Similarly, using the Kunneth formula one can prove that every connected surface (without boundary) is prime, except for the torus, $T^2=S^1\times S^1$, the annulus $S^1\times {\mathbb R}$ and the plane ${\mathbb R}^2$.
Another thing to note is that prime decomposition of topological spaces is not unique. The standard example is given by $S_{0,3}\times {\mathbb R}$ and $S_{1,1}\times {\mathbb R}$, where $S_{0,3}$ is $S^2$ with 3 points removed and $S_{1,1}$ is $T^2$ with one point removed. As noted above, both $S_{0,3}, S_{1,1}$ are prime but they are not homeomorphic to each other. At the same time $S_{0,3}\times {\mathbb R}$ is homeomorphic to $S_{1,1}\times {\mathbb R}$.
I do not think the study of uniqueness of product decomposition or of primeness of topological spaces is a currently active research area.