Firstly you need to unwrap mesh into UV editor in Edit mode.
STEP 1: Goto "Edit mode" in 3D viewport by pressing TAB key or using the menu below
Once you are in Edit mode like this
Drag the window below just like this
Now, follow the image below to go into UV Editor.
Then hit U in 3D viewport and press "Unwrap" in the menu from the image below
After the unwrap you'll get unwrapped mesh in UV Editor something like the below image.
But you can see that all the unwrapped mesh is overlapped in UV Editor in image no.5.
You have the same problem with the mesh.
Now the solution starts.
You need to select the vertices of the mesh so that when unwrapped it needs to be unwrapped good. Check out the reference cube image that has its vertices selected.
After the selection of vertices in the mesh hit Ctrl+E in 3D Viewport and select "Mark Seam".
Then hit select all the vertices A+8 x2times, after all the vertices are selected, Hit U and select "Unwrap".
Now, after the mesh is unwrapped correctly, create new texture
And continue your Texture Painting.