You should put all your personal work you have done, and will do on github. Not only does it provide a “backup” for all your work, it also directly shows your work as openly as possible. If your github is filled with a wide variety of interesting projects, then an employer might be more attracted to you for a position, rather than having no github or an empty one. Further using github requires some knowledge of
git, which is essentially the industry standard for version control, and is almost always a “nice to have” requirement on most job applications.
If you are a front-end dev in any capacity, you should have a portfolio that shows off you can build a website, and can visually show off your projects. This will show you have some experience building front-ends, and be able to show off other work you’ve done that is related and provide another platform to “sell yourself”. Think of it as an interactive resume/showcase of what your capable of.
If your not a front-end dev, then you can have a portfolio, but it will be less flashy and less of a showcase, but more of a secondary resume and a way to get in contact with you. This can still work, but is of less importance as if you don’t build UI’s, there isn’t as much to show off.
I see this more as a bonus to show off all your projects. Github is more popular, more professional and can be used to show off any kind of applications/code. Codepen is isolated to just front-end work. It might be a good place to show off smaller front-end projects, but I wouldn’t use it as your only “hosting environment” for your front-end work. Optimally the work you build and show off in your portfilio should be hosted somewhere else other than codepen, as codepen adds their own “branding” to your site which makes it seem less professional.
Also if you have a full-stack app you must have some other hosting environment (probably heroku, as they have a free tier), so again codepen is too limited. Bonus points go into if you use any kind of technologies asked on most job applications, like cloud technologies like AWS, Azure, and GCP.
Finally, its worth keeping in mind that depending on the jobs your applying to, you want to stand out from the competition as much as possible. This could mean having more expansive projects, more experience in different technologies, or “fancier stuff” that just catches employers eyes. You don’t want to do only what everyone else does, or the bare minimum, as then you just blend into all the other applications and wont have a chance. Applying and getting the job is as much about selling yourself over your competition, as it is having the necessary skills required to get and do the job in the first place.
Good luck, keep building, keep learning