Hint: In order to solve this problem, firstly draw the diagram of the cube and count the number of edges in it. Doing this will solve your problem and give you the right formula.
Complete step-by-step answer:
The above diagram is of cube of edge length $l$.
We know all the edges of the cube are of same length let it be l(say).
Hence, the cube has 12 edges.
So, sum of length of edges =12$l$
Hence formula for the sum of edge length =(12× one edge length)
So, the sum of all of the lengths of the cube of edge length $l$ is 12$l$.
Note: Whenever you face such types of problems of finding the formula of sum of all the edge lengths of a symmetrical body, then draw the diagram of the body and count the edges and generate a formula which is applicable for that body everywhere. Proceeding like this will give you the right formula.