There's really no wrong way to do it, as long as you're not causing injury to yourself.
Generally a man will just grasp his penis and stroke it. If he has enough foreskin to roll over the glans (the head of the penis) he can generally masturbate without lubrication. Otherwise, lubrication might be needed to avoid irritation, chaffing, etc. If it hurts, or is sore afterwards you're probably doing it too rough or need lubrication.
How long depends on you. Most people masturbate until they've reached orgasm. If you can't yet reach orgasm it's probably just because of your age or you need practice and to learn your body.