Instructions
Engage in conversation with your companions whenever possible, until their dialogue trees are exhausted. Regardless of the companion or their alignment, the correct option to gain influence is always to agree with their viewpoint, support their opinion or make them feel worthwhile. New dialogue options unlock on each planet and after major plot occurrences.
Kill innocents for Dark Side companions. This specific mechanic automatically gains influence over Dark Side aligned companions and usually appears as a special option in conversation with certain non-player characters (NPC).
Choose the companion you want influence over and take his side in conflicts with other companions. This gains influence with the companion you side with, but also loses influence with the companion you sided against. This makes your influence choices consequential, since every companion cannot be swayed to your point of view or will like you as a leader.