Hello, I Am Not Sure If It's Problem, But I
Your problem is mostly Psychogenic in nature
Detailed Answer:
Hello thanks for query
Based on the facts that you have posted you are facing problems of not getting orgasm and ejaculation while having sex with your wife where as you are getting orgasm while masturbating This is mostly due to following two factors
1) Psychlogical fantacy that is always associated while masurbating
2) Penile stimulation that plays important role in getting orgasm caused by the firm grip of penis by hand which is lacking during intra vaginal sex
This problem can be resolved by modifying sex technique like Start and Stop technique
Consult qualified Sexologist to learn how to do modify these techniques.
Taking drug like Sildenafil (Viagra) does help to resolve the problem
Please do write if you need any more help
Thanks and Regards
Dr Patil