I bought recently a Mazda 3 2006 (120,000KM, I just changed the oil and the battery) and after just 1 week I starting experiencing shakes, noises (tgtgtg pause tgtgtgtg, and so on) and than the engine is dieing when I stop the car at the stop signs. I should turn off the engine, put it in Parking then turn on the engine to make it run.

What could it be and how much should I expect to pay to fix it at a mechanic?

If you tell me a computer problem, 9 out of 10 I know the answer, but I am pretty dumb when is coming to cars. Please help