What if you know that it is a sin but you don't have the self-control to stop yourself from doing it? Are you going still going to be forgiven if you repent for it right after you've done it?
Nope. I thought this for years, but God has shown me quite differently in the past month or so.
Like Theophilus, my #1 weakness is lusting after the flesh. For 20 years, I have had the desire to see unclean images...and I'm only 28 years old. Fortunately, I've never acted on them, but the desire to see them has kept me chained to sin for the entire duration. I prayed to God literally hundreds of times to take the desire out of my heart. I would be "clean" for months at a time, but always gave back in. I've learned 3 VERY important things recently.
1. GOD HATES ALL SIN. Even when I was "clean", I would still look longingly at lustful images such as billboards, girls in beer commercials, women in the mall, etc. This isn't so bad, I thought, it's not like what I used to look at. I was so wrong. I never gave up the desire, but tried to supress it. All sin is hated by God, nothing can be unclean and stand before His glory.
2. God will not take this desire out of my heart. I used to pray that He would remove it, do the hard work, and I'd be "cured." I know now that this is ridiculous. God wants me to have the desire for two reasons. First, it should be directed 100% to my wife. Now that it is, I cannot tell you how much better our lives are, but that's another story. Second, and more importantly, God has given me this weakness so that I will rely on Him. I can't do it alone, period...I need Him.
3. I never truly repented. I turned from sin, promised to never to it again, and felt better for a period. But, after He got ahold of me after recent weakness, He showed me how I never repented. After a long conversation with Him and true repentance, I now HATE my sin.
What if you know that it is a sin but you don't have the self-control to stop yourself from doing it?
From my very recent and personal experience, you have not truly repented. Now, I cannot even stand the idea of lustful images. In the past, I still wanted them in my life, but simply denied myself looking, which always led to failure. Now, with the Holy Spirit with me at all times, the thought of messing up hurts me. I still don't have the self-control and never will. But, the Holy Spirit is the definition of what I wanted self-control to be. HE gets me through the temptation. In the past, I would see a woman bend over, relish the image, and think I got away with a quick look. Now, I see the same thing, immediately turn away, and hate the idea of it. Does that make sense? I no longer want the sin, whereas before I still did. I NOW HATE MY SIN, which leads to the Holy Spirit giving me self-control.
That's a long answer, but my life has been changed due to these revelations....maybe it will help others.