Honestly if you are careful and cover your tracks well you can hide it for a long time. I'm not proud but I've been having an affair for a while and whilst we've had a few close calls (mainly due to us getting complacent), it's been easy to hide.
If you always pay in cash, regularly delete your call history and texts, meet during the day and most importantly don't tell anyone at all because as you can see from some of the replies on this thread a lot of people don't and won't keep your secret.
It is a lot easier when you have a partner who doesn't pay you attention because they don't notice the signs that are obviously there. My AP has the problem that his wife has noticed the change in his behaviour but at the moment can't actually prove anything. My husband has noticed too but he's not mentioned it like she has, she's outright asked if my AP is having an affair.
Do I think my affair will stay hidden forever? Probably not if I'm honest because karma has a way of catching up with everyone. The difficulty your friend will have is when he wants more because he's single, I've seen so many affairs get exposed by the party who are single and have nothing to lose. The awkward part for you is when it comes out you'll be the bad one for knowing and not saying anything, that's another reason why I won't tell anyone because I don't want to drag them into my web of lies and deceit.
It's also very mentally draining living a double life and this is why people get found out. It's so hard to hide your emotions sometimes and they are what will give you away. If I could go back and someone had told me I'd end up in this situation I'd have run a mile because it's hard being in love with someone you can't have and I'd tell anyone who's embarking on an affair to have a long hard think about it before it starts because once you catch feelings for that person it's unstoppable and your life will revolve around your next opportunity for a phone call or meeting with your AP.
If we were brave enough we'd both leave and start a life together but there's complications that at this time prevent us from doing so, and yes I know I'm a walking cliché before anyone jumps on and tells me. I also know how bad a person I am and how selfish I'm being, trust me there's no one harder on myself than me so there's nothing anyone can say that I haven't already told myself but the truth is I can't give up my affair and probably won't until I get caught.
Whatever happens when I do get caught I'd have brought upon myself and I'm fully prepared for the consequences and the aftermath of it and I know I'll deserve everything everyone will say about me.