system
Given the following post, respond as if you're commenting on Reddit:
human
How does your stomach know when to stop digesting food and move it into the small intestine?
gpt
Let's start at the top - what does your stomach actually do?  It doesn't really "digest" food that much.  It's mostly a storage pouch.  It acidifies food to kill any pathogens, and has muscle contractions to break food up a little bit more.  It does have a few digestive enzymes - but they're not super important in the large scale.  

So how does it know how long to store food for?

The way this is accomplished is actually super interesting.  Basically, your stomach is usually kind of "open" - a tiny bit of food can pass through it into the intestine.   When some of the food hits your small intestine, specialized cells that detect the presence of fatty acids and proteins recognize that food is coming down.  These cells release a chemical called CCK.

CCK has a bunch of effects, and is the primary thing your body does to say "hey, we've just eaten, lets get into dealing with food mode."  It causes your pancreas to release enzymes that break down food so it can be absorbed into your body.  It causes your gall bladder to release bile which aids fat absorption.  And it tells your stomach to hold up and slow how much food it's letting into the small intestine.

So basically, your stomach lets a bit of food out.  Your intestine recognizes this food, and releases CCK saying "hey, we're dealing with food - slow down." Then your stomach slows down.  Then, there's less food - so less CCK.  So your stomach lets some more food out.  Then CCK slows things down.  It basically rests in an equilibrium so your stomach is only letting out enough food that your intestine can deal with it, until you're done with your meal.

EDIT:

One other notable effect of CCK on the stomach: CCK tells the stomach to produce less acid - so when that as it empties its contents into the intestine those contents will be less acidic, because your intestine isn't really designed to deal with acid in the same way your stomach is.