In short, yes, you can create new files in OnlineGDB.There are two icons left of the green RUN button (right to left: upload a new file; create a new empty file). You can utilize these to add files to your OnlineGDB project.
To add a bit more detail, what you're talking about here is C++ header (.h) and source (.cpp) files. The header file is for declaration, i.e., to describe the functionality of the class, and specify the signature of the functions, list the fields the class has, list constants, specify macros, etc. in the file.
The source file is the definition of those in the header file, where you actually tell how the functions behave.
Also, it seems like CodeBlock had some auto-generated code. OnlineGDB doesn't seem to have this, but it's a good practice to learn writing classes from scratch to better understand how they are built up.
I hope this helps.
Have fun coding! :)