Thoughtcrime is thinking of anything that the Thought Police and the Party deem is illegal. Illegal is anything that creates individuality--not the best thing for the Party as a whole. They want Party members to remain isolated so that no one can band together and rebel like the Proles.
For example, Winston continually looks around during the Two Minute Hate and peruses the crowd for others who might give away for even the briefest of seconds that he/she might also be against Big Brother like he is. This is where he thinks O'Brien is against the whole Party thing, and also where he repeatedly finds himself staring at Julia before they formally meet.
Julia's passing the note to Winston is also thoughtcrime. It proves that she has been "thinking" for a while about having a relationship outside of the Party which is forbidden. Therefore, the affair she and Winston have is absolutely illegal.