So if I open Opera but don't touch it for 20 minutes because I am in VStudio, I want it to kill the program.
Someone could write a program to do that if they were so inclined, but I'm not sure it's a good idea. Killing a process doesn't give it the opportunity to save its data, and might give the user a nasty surprise if they had been doing something important and got distracted for a few minutes. Perhaps you mean "ask the window to close", which might bring up a "do you want to save your work first" dialog, which would be distracting.
A better option might be to minimize the window, which causes the owning process to have some of its memory paged out, leaving more physical memory free for whatever program you are actually using.
See the MS knowledgebase article The working set of an application is trimmed when its top-level window is minimized.