How can I retrieve photos/screenshots from codepen and use them as thumbnail pictures in my project like the template?
You could take a screenshot using your operating system and edit it as necessary to the size you want. Alternatively, you can find browser extensions that will take a shot of just what you can see in the browser window.
Is there a free cloud storage out there that I can upload the photos there and href them from codepen?
This question has been asked many times on the forum. I suggest doing a quick search on the forum to see the various posts on the topic.