I want to cradle my friend and play with his hair while he sleeps.
I hope you would ask him for consent before doing this. Is he okay with you holding him and touching his hair?
He always tells me when he wakes up to stop touching his hair, but I never stop.
It is good that you like your friend and want to be close to them, but its not good to be touching them and bothering them while they are sleeping. If he is asking you to stop, then you need to respect his wishes and leave him and his hair alone.
But he is my friend.
If he is your friend, then you should understand why it's so important to respect him. It sounds like your actions are making him uncomfortable, and if you continue, it is likely he won't want to be your friend anymore. You need to ask for consent before you touch anyone, especially your friends.