Some things, if they happen during your prayer, break it: meaning you have to start it again. Here are the main ones.
Take care
Talking during prayer breaks it, whether you meant to or not, whether it's a lot or a little, even talking in your sleep if you happen to doze off. Counted as "talking" are things like: answering someone (even by quoting a Qur'an verse), greeting someone with Salam, answering a greeting, saying "may Allah have mercy on you" to someone who sneezed, saying "Alhamdulillah" out loud at good news, saying "Inna lillahi wa inna ilayhi raji'un" out loud at bad news, exclaiming "SubhanAllah" out of surprise, sighing "Ah" or "Uff" over something painful, crying out loud from pain in a way that makes actual words, clearing your throat on purpose with two clear sounds, asking Allah for something you'd normally only ask another person for, and reading Qur'an from a page out loud.
Take care
Eating or drinking on purpose or by accident, even a tiny bit, breaks the prayer.
Note
One exception: if a bit of food smaller than a chickpea is stuck between your teeth and you swallow it, that's fine; it doesn't break your prayer.
Take care
A big movement that isn't part of the prayer, and doesn't need to happen, breaks the prayer.
Take care
Missing any of the six conditions for prayer (like being clean, or facing the Qibla) means it's invalid, and missing any of the seven pillars (like bowing) means it's invalid too.
Note
The source text also says that skipping something compulsory on purpose makes the prayer invalid; this line is a bit unclear about which level of "compulsory" it means, so it has been flagged for the site owner rather than guessed at.
Remember
Things that do NOT break your prayer
Scratching once or twice, without raising your hand up high each time, is fine; it's only a problem if you do it three separate times in one rak'ah, raising your hand each time. If a follower quietly reminds the imam of a word he's forgotten, that's fine too, as long as it's not the imam feeding words to someone else. Crying because you're thinking about Paradise or the Fire, not because of pain, does not break your prayer either.
If you're praying by yourself out in the open, it's good to put something small in front of you, like a bag, about a hand's height, roughly three hand-lengths in front of where your eyes would look: this is called a sutrah. If someone still walks in front of you, it's the passerby who is doing wrong, not you; your prayer stays valid either way. If you're following an imam, his sutrah covers everyone behind him too.
Note
If there's no sutrah and someone tries to walk right in front of you, you should try to stop them: a man does this by saying "SubhanAllah," and a woman by clapping her hands, instead of speaking.
Tip
Sometimes you must stop your prayer
If you're praying and something urgent happens (you desperately need the toilet, or someone needs saving from drowning or fire, or a blind person is about to fall into a well, or your parents call you during a nafl prayer without knowing you're praying), you should stop your prayer to deal with it. It's also fine to stop your prayer to kill a dangerous snake or scorpion, to stop an animal running away, or to save something valuable.
A number of actions break (invalidate) the prayer if they occur during it.
Take care
Speaking during prayer (whether intentional or accidental, whether in a dream or while awake, whether little or much) breaks it. The following are treated as speech for this purpose: responding to someone's speech (even with a Qur'anic verse), greeting someone with Salam, responding to a Salam, saying "Yarhamuk Allah" to someone who sneezes, saying "Alhamdulillah" on hearing good news, saying "Inna lillahi wa inna ilayhi raji'un" on hearing bad news, exclaiming "SubhanAllah" or "La ilaha illa'llah" out of astonishment, sighing or exclaiming "Ah" or "Uff" at a calamity, crying from pain or suffering with a sound that forms letters (crying from fear of Jannah or Jahannam does not invalidate it), clearing the throat unnecessarily with two distinct sounds (excused where there is a genuine need), making a supplication phrased as something ordinarily asked of people rather than of Allah, reading the Qur'an aloud from a written page (looking at a page and understanding its meaning without vocalising it does not invalidate the prayer), and reciting the Qur'an incorrectly in a way that changes or corrupts its meaning, including a melodic recitation (ilhan) that distorts the meaning through exaggerated vowels or consonants.
Take care
Eating or drinking, whether intentionally or accidentally, invalidates the prayer even in a small amount, except that something smaller than a chickpea left between the teeth, if swallowed, does not invalidate it.
Take care
Any large or unnecessary movement that is not part of the prayer's own actions, and serves no purpose related to it, can break the prayer.
Take care
Not fulfilling any of the six conditions of prayer invalidates it, and so does not performing any of the seven pillars (arkan).
Note
The source also states that if a compulsory act is deliberately omitted, the prayer becomes invalid. It is not clear from this passage alone whether "compulsory" here means a pillar (restating the point above) or a wajib act; the wajibat are elsewhere corrected by Sajdah Sahw rather than invalidating the prayer. The original wording is kept as printed, and the question has been recorded for the site owner rather than resolved by guesswork.
Remember
What does not break the prayer
Giving or receiving a luqma (prompting a forgotten word) does not invalidate the prayer, so long as the one giving or receiving it is not the imam himself; a follower prompting the imam does not invalidate it, whether or not the imam had already completed the required recitation. Scratching is not a problem unless it becomes excessive, which it does if done three separate times within one rak'ah, raising the hand each time; occasional scratching does not break the prayer.
If someone passes in front of a person praying, it does not affect the validity of that person's prayer, though the person passing is sinning. If the person praying is on raised ground such that the passerby's body is not directly level with them, there is no sin on the passerby either. Someone praying in an open area should place a barrier (sutrah) in front of them, about a hand's height and roughly a finger's thickness, positioned about three hand-lengths in front of the right eyebrow; if a standing barrier cannot be placed, it may be laid flat, lengthwise rather than widthwise. An imam's sutrah suffices for everyone following him. Once a barrier is in place, passing beyond it carries no sin.
Note
If there is no barrier and someone attempts to pass in front, the person praying should try to stop them: a man by signalling or saying "SubhanAllah," a woman by clapping her hands, rather than speaking to them.
Tip
When breaking the prayer is necessary or permitted
If an urgent need to relieve oneself arises, or an emergency calls for help (such as rescuing someone drowning or on fire, or saving a blind person about to fall into a well), breaking the prayer becomes necessary. Likewise, if a parent calls during a voluntary (Nafl) prayer without realising the person is praying, breaking the prayer to answer is necessary. It is also permissible to break the prayer to kill a snake or scorpion, to stop an animal from running away, or to save an item worth around four grams of silver.
A number of acts, arising within the prayer, invalidate (mubṭil) it.
Take care
Kalām (speech) invalidates the prayer regardless of intent, of whether uttered asleep or awake, and regardless of quantity. The following are treated as kalām for this purpose: responding to another's speech, even by a Qur'anic āyah; initiating or returning a salām; saying "Yarḥamuka'llāh" to one who sneezes; "Alḥamdulillāh" on good news; "Innā lillāhi wa innā ilayhi rājiʿūn" on bad news; "Subḥānallāh" or "Lā ilāha illa'llāh" uttered in astonishment; a sigh or exclamation such as "Āh" or "Uff" at a calamity; weeping from pain that produces articulate letters (weeping from fear of Paradise or the Fire is excepted); throat-clearing with two distinct sounds absent a genuine need (present need excuses it); a duʿāʾ phrased in terms ordinarily addressed to a person rather than to Allah; reciting the Qur'an aloud while reading from a muṣḥaf (silent comprehension of a written page, without vocalisation, does not invalidate); and miscorrecting the recitation so as to alter or corrupt the meaning, including laḥn or exaggerated ilḥān that distorts the sense through mispronounced vowels or consonants.
Take care
Listening or attending to, and acting upon, a person extraneous to the prayer likewise invalidates it.
Take care
Akl wa shurb (eating or drinking), whether deliberate or inadvertent, invalidates the prayer even in a minimal quantity, save for a residue smaller than a chickpea lodged between the teeth, which does not invalidate it if swallowed.
Take care
Qahqahah, audible laughter, by an adult invalidates the prayer (and, on the standard Ḥanafī position outside this passage, also renews the wuḍūʾ, though that further consequence is not addressed here).
Take care
ʿAmal kathīr, substantial or unnecessary movement extraneous to the acts of the prayer and serving no purpose connected to it, invalidates the prayer.
Take care
The absence of any of the six shurūṭ invalidates the prayer, as does the omission of any of the seven arkān.
Note
The passage further states that the deliberate omission of a "compulsory" (farḍ/wājib) act invalidates the prayer. Taken in isolation, this is ambiguous as to register: read together with the immediately preceding point it most likely restates the omission of a rukn, but read as a fresh point it would appear to extend invalidation to a deliberately omitted wājib, a position at odds with the treatment of wājib omission elsewhere in this same source (corrected by sajdat as-sahw, not invalidation). Rather than resolve the ambiguity by inference, the original wording is preserved and the question is recorded in this batch's review flags for the owner to adjudicate against the fuller text.
Remember
What does not invalidate the prayer
The giving or receiving of a luqmah does not invalidate the prayer, provided the imam himself is not the one supplying it to another; a muqtadī's luqmah to the imam does not invalidate it, whether or not the imam had already discharged the recitation due from him. Scratching (ḥakk) is unobjectionable unless it becomes kathīr, which it does where performed three separate times within a single rakʿah, the hand being raised each time; an occasional scratch does not invalidate the prayer.
Where a person passes in front of one praying, the validity of the prayer is unaffected, though the passerby himself sins; where the one praying stands on elevated ground such that the passerby's body is not level with him, no sin attaches to the passerby either. One praying in open ground should set a sutrah before him: about a hand's height and a finger's breadth, positioned roughly three hand-spans ahead of the right eyebrow; where an upright sutrah cannot be placed, one may be laid flat, lengthwise rather than across. An imam's sutrah suffices for the entire congregation behind him. Once a sutrah is in place, passing beyond it carries no sin at all.
Note
Absent a sutrah, one praying should attempt to prevent a person from passing directly in front: a man by gesture or by saying "Subḥānallāh," a woman by clapping one hand against the other, rather than by speech.
Tip
When qaṭʿ aṣ-ṣalāh (breaking the prayer) is obligatory or permitted
Where an urgent bodily need arises, or a genuine emergency calls for intervention (rescuing one drowning or caught in fire, or a blind person about to fall into a well), breaking the prayer becomes wājib. Likewise, where a parent calls during a nafl prayer unaware that the person is praying, breaking the prayer to respond becomes necessary. It is further permitted (mubāḥ), though not obligatory, to break the prayer in order to kill a snake or scorpion, to prevent an animal from bolting, or to preserve property of a value roughly equal to four grams of silver.