I am learning about affine functions and I do not understand why a certain type of functions ( functions that are in the form of f(x)=a*x+b ) are called affine functions. I read about the word affine and i know it means related by I do not understand how is it related to this type of functions.
It may help for the mathematically inclined to think about affine functions operating on a vector space and for the non-mathematically inclined to think about that familiar vector space, our three-dimensional world with its familiar numbers and operations (i.e., multiplication and addition). Applying an affine function to all the points in a vector space gets you another vector space, and the question is what does the result look like? In other words, what does our world (or a picture of part of it -- call that a scene, if you will) look like after it has been transformed by an affine transformation?
The word affine comes from the Latin affinis meaning connected to or related to, and the transformed space is related to the original in a special way: by collinearity and the preservation of distance ratios. The former means that straight lines in any original scene are still straight lines in the transformed scene; the latter means that a point two-thirds the way toward the far end of line in the original scene is still two-thirds of the way toward the far end of the transformed line.
The result of an affine transformation may distort the original space (rotate it, stretch it, shrink it, etc.) but the result is still recognizably connected to the original. Think geometrically. In a non-distorting transformation, e.g, a translation, say, moving things left or right, there's a congruency between triangles: moving a triangle two inches to the left gives you a congruent triangle, one with the same side lengths and angles measures. It's just displaced. In a slightly distorting transformation like a shrinking or expansion, you get a similarity -- the new triangle's sides aren't the same length as the original but the angle measures are preserved. In a general affine transformation, the angle measures may be different, but the transformed triangle is related to the original. (We say they have an affinity.) The transformed triangle is still a triangle -- three connected sides -- and the transformed midpoints of the sides of the original are still midpoints of the transformed sides.
Thus you have a sequence of relationship types -- congruency (strongly connected or related, same size and shape), similarity (moderated connected, same shape but different size), and affinity (recognizably connected, same configuration but different shape and size).
You're right, the term 'affine' is a little abstruse. I think deadrat's answer is about as good as you will get as to how the etymology of the term might be related to the concept.
As to an origin, a mathematical term 'affine' is defined in connection with tangents to curves in Euler's "Introductio in analysin infinitorum" of 1748, Book II, Ch. XVIII, art. 442. You can find that in Latin at Gallica https://gallica.bnf.fr
I want to add that in mathematical literature, the modifiers "linear" and "affine" are often conflated. The term "linear function" is often used to mean the same thing as "affine function". On the other hand, the term "linear transformation" specifies one that maps the origin to itself, whereas "affine transformation" would definitely be understood to involve a translation of the origin.
What happened here is, in different circumstances each of these related ideas became of primary importance, and at some point, a distinction needed to be drawn. Unfortunately, people had already staked claims to various territories, so the resulting lines weren't very straight. It is a historical accident.