Using one is generally not the criminal act — running one usually is the problem.
Private servers are typically built from a game's code or assets without the rights holder's permission. Creating and distributing that server is where copyright and terms-of-service violations arise, and rights holders have taken legal action over exactly that. As a player, connecting to one is normally a breach of the game's terms rather than a crime, though it can still cost you your account.
There are legitimate exceptions: some games are released with official private-server support, and some publishers permit community-run servers. Those are worth checking before anything else.