Definition
A sample space is the set of all events inside whatever context you’re paying attention to, as in an experiment.
Sample spaces come in different shapes and sizes. They can be finite or infinite, countable or uncountable, and these properties determine how we can assign probabilities to different events within the sample space.
Generally, if the sample space is countable, a probability can be assigned to every outcome. If the sample space is uncountable, probabilities can only be assigned to collections of subsets of the sample space, called sigma-algebras.
Examples
If you have a standard deck of 52 cards and your “experiment” is to draw one of those cards, then the sample space contains 52 events, one for each card in the deck. The sample space is finite and countable, so we can assign one probability to each event (which is $1/52$ for each event).
If instead, your experiment is to ask your friend to pick a number between 1 and 100, then the sample space is $x \in \mathbb{Z}$ such that $1 \leq x \leq 100$. The sample space is finite and countable.
If your experiment is to measure the height of different flowers, then the sample space is $x \in \mathbb{R}$, and so is uncountable.