There are two main reasons to get your companions affection up. The first is that they give you specific missions as you gain more affection, letting you not only get additional experience but add a little more flavor to things as your leveling up.
The second reason is to make them more effective at crew skills.
The higher their affection for you the faster they'll be able to preform their tasks, and are more likely to be critically successful in the process.
As you get their affection higher, the effect of each gift lowers. There are five ranks of gifts, and you'll want to give your companion the appropriate level of gift.
Imperial Agent: Best Lines and Funny Moments - Star Wars: The Old Republic
You can tell what's a good gift by taking a look at their affection score. Each level is an even 2000 points and is graphically shown in segments on the companion tab of your character screen.