If you come across a player in a PS4 game that has a name like Temp1247, chances are it's not by their choice. With the recent introduction of the ability to change names on PlayStation accounts, Sony has implemented a policy of automatically changing the names of players who had offensive or rude names before hand.
As Gamasutra explains, any PlayStation Network ID that violates the PSN terms of service with regards to specific words or offensive language will be automatically given the temporary placeholder ID of "TempXXXX," with the option for the owner of that account to change it themselves afterwards.
While this might seem like censorship, this is actually a walk back from Sony's previous policy of just banning offensive gamers outright if they had specific language in their username. This may mean expanding the list of words that fall under that remit, but for now it seems like the system is proving effective, with reports of Temp names showing up in a number of games as people's poor choice of usernames are corrected.
If you change your name to something that the PSN flags up as offensive you'll be given a Temp name automatically. However, the process for reverting to your original name is relatively easy. As Gamasutra explains, though, if your name is changed because the original was offensive, it can take a little bit longer to create a whole new one to change the account to.
For more information on the PSN switch up, visit the FAQ page here.