What's the difference between environment and memory in terms of programming languages?
Functions

The terms "associate" and "map" together with "finite" indicate that both definitions refer to finite mathematical functions.

A (mathematical) function is a relation that associates each element of a set, the domain of the function, to a single element of another set (possibly the same set), the codomain of the function [Wikipedia].

Another way to put this, for finite functions are: a finite set of ordered pairs.

Map is usually defined as a synonym to function.

Thus the definitions could be rewritten as follows:



Environment

An environment is a finite function that associates each element in the finite set of variables (domain), to a single element in the finite set of values (codomain). The range would be the set of all possible values (possibly infinite).

Memory

A memory is a finite function that associates each element in the finite set of locations (domain), to a single element in the finite set of stored values (codomain). The range would be the set of all possible values (possibly infinite).



Sets


  Does this mean that environments are a part of memory?


Since this is about sets, if you by part mean subset, then the answer would be no.

However, the codomains are definitely related, if a variable is associated with a value in the environment, a location must also be associated to a stored value in the memory, that corresponds to the variable value.



Extending the Environment


  The part that especially confuses me is when we "extend the environment."


It seems the aim of the text is to build an interpreter. You start out with no variables declared (including procedures), i.e., an empty environment and then you interpret/parse/analyze the code to make these associations, i.e., extending the environment.



In Practice

It might be helpful to think of the memory as the values stored somewhere in the physical memory and the environment as the values that the interpreted process currently knows about.