We got a PS4 and my question was if I could have multiple PSN account names, because my friend and I want to play with different names.
If I'm understanding your question right, yes, you can have multiple accounts. However, you will be a bit restricted on what content you can access across them.
For instance, if you purchase a game on account A and the PS4 is not account A's primary console, account B will be unable to access it. However, if account A does have this console listed as its primary, account B (and accounts C, D, E, F, and G) will be able to access content licensed to account A.
It's worth noting that only account A will be able to download games that it owns the license to. For instance, if you own the Season Pass for an episodic game like Life Is Strange, but don't have the episodes downloaded on the system, account B will be prompted to purchase the Season Pass rather than being able to simply download it. (This is from firsthand experience within the past week)
Another important thing to note is that all but the account with the PS4 listed as its primary will not have their PS+ benefits shared. See this question for more info about that.