This question already has an answer here:
In the opening scene of Star Wars: Episode IV: A New Hope, as 3P0 and R2D2 are scuttling about the ship, 3P0 says:
"There'll be no escape for the Princess this time".
Obviously, he knows who Leia is. But later, when Luke removes R2's restraining bolt, inadvertently causing him to play back part of Leia's secret message, Luke asks who the woman in the hologram is, and 3P0 says:
"I'm afraid I'm not quite sure, sir... I think she was a passenger on our last voyage. A person of some importance, sir -- I believe."
Now, R2 doesn't trust Luke yet, and deliberately avoids playing the full message for him. But 3P0 trusts Luke immediately, and actually chides R2 for his insolence, reminding him that Luke is now their master, and therefore deserves their obedience and respect.
So why does 3P0 hide the princess' identity from Luke? Even more important, why does he actively lie to Luke?
Note: I know that some people will claim that 3P0 knew that Leia was important, and that there was a princess onboard the Tantive IV, but he didn't necessarily know that Leia was the princess. This is extremely unlikely. Wookieepedia says that the Tantive IV held about 85 passengers and crew, a relatively small number, which makes it very likely that 3P0 would have known who the princess was. It also seems unlikely that 3P0 would show such concern about someone he has never met. If he doesn't know the princess, why single her out as a special cause for concern, as opposed to all the people he does know? He apparently belongs to Captain Antilles - if he didn't know the princess, wouldn't he say "There'll be no escape for Captain Antilles this time"?