Does your check engine lamp stay illuminated when you restart it?
How frequently does this happen?
When it happens, does the car start back up normally?
Does it stall when in neutral as well as in gear?
What engine do you have?
At present, there's not really enough information to hazard a good guess--
there's just too many possibilities. It could be lack of fuel, an
electrical issue, or something with the fuel management system. More info
(if you can provide it) may help.
I'd recommend returning it to the dealer for service. There's obviously
something wrong.