The key term in your question is working memory.
Working memory is involved in information-processing functions such as encoding, storing, and retrieving data and it is a system that temporarily stored and manages information required to carry out cognitive tasks, such as learning, reasoning, and comprehension.
One relatively straightforward test to assess working memory is memory span. In this test the number of items (usually words or numbers) is determined that a person can hold onto and recall. In a typical test of memory span, an examiner reads a list of random numbers aloud at about the rate of one number per second. At the end of a sequence, the person being tested is asked to recall the items in order. The average memory span for normal adults is 7 items (source: Medicine Net).
Note that the definition of working memory, as opposed to short-term memory and, to a lesser extent, long-term memory are not that well defined. In fact, Medicine Net links two identical webpages to short-term memory and working memory. The difference between working memory and short-term memory is indeed subtle. Working memory is generally thought to rely on short-term memory, but to additionally involve processes to effectively use those memories during cognitive tasks. The difference may be explained as (Cowen, 2008):
[W]orking memory includes short-term memory and other processing
mechanisms that help to make use of short-term memory.
The difference between short- and long-term memory stores is based on a difference in their duration and in their capacity (Cowen, 2008). Long-term memory, not surprisingly, is of longer duration and it can hold much more information. However, it cannot be accessed as readily compared to short-term and working memory.
- Cowen, Prog Brain Res (2008); 169: 323–38