What is the need of using two different stacks in same program? How does trap change the current stack of program from user stack to kernel stack? How does it come back to user
what is the need of using two different stacks in same program
I've never heard of both a kernel and user stack in terms of a single process, though it may be extremely common. It's discussed here.
The kernel stack must be isolated from the user mode stack. Otherwise, user mode code could corrupt the kernel stack, causing a kernel crash.
how does trap changes the current stack of program from user stack to kernel stack
You may want to look for something like the Intel Software Developer's Manuals.
does each process has kernel and user stack
I assume this varies with operating system design, though perhaps it's fairly universal. The links I provided above indicate that Linux uses two (or more) stacks per process. I haven't heard of Windows using a per-process kernel-mode stack.