online-mode is a setting in server.properties. When it's true (the default), your server checks with Mojang that every player owns Minecraft and really is the account they say they are.

Keep online-mode=true. Turning it off ("offline mode" or "cracked") is the single biggest security risk you can take on a Minecraft server.

What happens if you turn it off

The one good reason to turn it off: a proxy

If you run a network with Velocity or BungeeCord, the backend servers have online-mode=false, because the proxy handles logins. This is only safe when:

  1. The proxy itself has online mode on.
  2. Player info forwarding is set up. For Velocity, use modern forwarding with a secret shared between the proxy and each Paper server. For BungeeCord, set bungeecord: true in spigot.yml.
  3. Players can't connect to the backend servers directly, only through the proxy.

If you're not running a proxy, there's no reason to turn online mode off. If someone has asked you to so they can join without buying Minecraft, the safe answer is no. Bedrock players can join with Geyser and Floodgate instead, without offline mode (see "How do I let Bedrock players join with Geyser and Floodgate?").