Considering you have only one spear available per match, it's probably best to use it when you're close to the opponent and need to quickly counterattack.
It's generally recommended to save your single spear for when you're facing an opponent with low stamina or health, so it can maximize its impact and ensure you get a good throw.