I disagree with the masses. I believe marriage is about full disclosure. My wife cheated on me, and finding out about it ended up saving our marriage... It opened the door to honesty. As one who believes very strongly in the 'emotional bank account' the best time to tell her is when things are good, and hope you avoid bankruptcy.
Look at it this way... If she ever finds out on her own --and I'll guarantee you that she suspected something when it was happening-- you're marriage is fubar. You coming forward and showing genuine repentance and sorrow now will hurt her, but be prepared to explain WHY you did it and WHY you will never do it again.