This depends on how heavy your flow is and how often you want to do laundry!
3-5 pairs are recommended for a cycle of 4-5 days. Of course if you wash them more regularly you can buy less and rotate them quickly!
Some pants are compatible with removable absorbent inserts that you can replace like you would a pad, which means you have to change pants less often (e.g. Luna Undies).