Let me back up a few lines to help you understand the conversation:
Claudius: …But now, my cousin Hamlet, and my son—
Hamlet: A little more than kin and less than kind.
Claudius: How is it that the clouds still hang on you?
Hamlet: Not so, my lord; I am too much I’the sun. [Hamlet, I.2.66-69]
Claudius, Hamlet’s uncle and now stepfather, addresses him as “son,” to which Hamlet mutters to himself “A little more than kin and less than kind.” Hamlet’s response is a retort; he realizes Claudius is mocking him by reminding him of his dual relationship with the King, flaunting the relationship he now shares with Hamlet’s mother. Hamlet bristles at the idea he is both “cousin” – a general term for relative – and “son.” Well aware of Hamlet’s attitude and distrust, the King responds in kind, wanting to know why Hamlet is so gloomy. The line that follows seems at first to be nothing more than a denial of any upset. But let’s look at this a little more closely. Hamlet’s denial is also an affirmation – he is “too much” in the presence of the sun, i.e. his distress is the opposite of upset. Shakespeare has cleverly juxtaposed the antithesis of clouds and sun, which modern audiences take to represent the antithesis of unhappiness and happiness. However, the metaphor digs more deeply than that. The “sun” can also be seen as representing the King. Think of the sun as the highest point in the sky, much like the King as the highest member in the community – both rule their respective kingdoms. Therefore, Hamlet’s comment is that he’s too much in the presence of Claudius, that he wants nothing to do with his uncle.
Hope this helps!
There are several other possible interpretations of Hamlet's statement that he is too much in the sun. And the interesting thing about this line is that all of the possible meanings may be included.
One would be that Hamlet is implying that he doesn't like being called Claudius' son. He is getting too much of that "son" business and would like the king to know he resents it.
Another possible meaning is that Hamlet is suicidal and doesn't want to exist in the world and its sunlight any longer.
Another is that he that as a dependent he doesn't have anything to do with himself and consequently spends much of his time just loafing around outdoors. (This is reminiscent of Orlando's complaint to his brother early in As You Like It.)
Claudius compels Hamlet to be present at these big court functions because he wants to exhibit him to everybody, making it seem that Hamlet is condoning his election as king and his marriage to Hamlet's mother. By saying that he is too much in the sun, Hamlet could also be implying that he is getting too much public exposure, too much spotlight. He may also be suggesting that he would like this present non-event to be over and done with so that he could leave.
Related to this, Hamlet may be implying that he feels uncomfortable with the king watching him and having others like Polonius spying on him. He feels he is exposed to bright lights and has no privacy.
Hamlet would like to go back to Wittenberg, but Claudius won't let him because he wants to keep him a virtual prisoner at Elsinore where he can watch him. Hamlet may also be implying that he would prefer to be studying inside the library at Wittenberg, and reading by candlelight in his room there at the university, to sitting idly outdoors.
Since Hamlet has no money, he could be implying that he feels like a homeless person who has to live outdoors, exposed to the elements.
Denmark is not noted for being a particularly sunny place. By saying that he is getting too much sunshine in a country similar to Sweden where people sometimes don't see the sun for months, Hamlet may also be making some sort of an obscure joke which would be hard to explain. There would be an analogy between not getting much sunshine and not getting much of anything else except for food and a place to sleep. He can't be getting much sun, but he is getting more of that than anything else.
Some of Shakespeare's ambiguities are so multifaceted that the possible meanings seem almost infinite. Hamlet is a genius and is far better educated than anyone else at Elsinore. He may be alluding to works of literature in Latin, German, French, or Italian which scholars haven't even identified. Claudius can't understand him--which only makes the king more suspicious and distrustful.