Gnomeballs are received by winning 5 points in a game of Gnome Ball or from the gnome restaurant minigame. With the item in your inventory, you can click "Use" with it, and click another player. If the player has both of his or her hands empty, they will catch the ball, and it will end up in their weapon slot. It is not advised that you throw it to a player you do not know, as they can very easily walk away with it.
It should also be noted that this item can help in reporting users suspected of macroing. By throwing a gnomeball at a player suspected of being a macro, it messes up its programing and halts them, thus allowing you to determine if they are macroing. This is not guaranteed to work however, as it depends on the type of macro that the targeted player is using.