First Taylor series, specifically for sine, cosine and arctangent, were developed by Indian astronomers of Kerala school to facilitate astronomical calculations based on geometric models of Ptolemy. The first written reference is a book by Jyesthadeva from early 1500s. Another book by Nilakantha from before 1545 attributes the discovery to Madhava (1349-1425). The derivations used iteration of trigonometric sum and difference formulas, a method that goes back to Aryabhata (c.490) and Brahmagupta (c.665). Unfortunately, the discovery remained confined to a small circle of practitioners in India, and did not become known in Europe until long after these series were independently rediscovered in 17th century. See Was Calculus Invented in India? by Bressoud, Ideas of Calculus in Islam and India by Katz and Madhava series.
In 17th century Europe the principal motivation for using power series came from the need to do effective computations with transcendental functions appearing in geometry, astronomy, cartography, navigation, and later mechanics. Briggs discovered the series for $(1-x)^{1/2}$ in 1620s, while working with newly introduced logarithms, and in 1668 Mercator published Logarithmotechnia that contained the series for $\ln(1+x)$. Around 1664-1665 in his tour de force discovery of calculus Newton found what he called a "universal method" for expanding any function into a series. His method was quite convoluted however, it involved inversion, binomial expansion, long division and termwise integration. Newton used the series to approximate quadratures (areas), interpolate values of functions, and more generally solve what we now call differential equations. In 1669 he produced a manuscript De Analysi per Aequationes Numero Terminorum Infinitas (On Analysis by Equations with an Infinite Number of Terms), which however was rejected by the Royal Society. So only examples for trigonometric functions and "binomial expansion of fractional exponents", i.e. $(1+x)^\alpha$, communicated through letters to Collins in 1670, came to be known.
Like Newton, Gregory was interested in expanding general functions into a series, and in 1671 he thought he figured out Newton's method. But he did better, he actually discovered the familiar relation between values of derivatives and Taylor coefficients, about forty years before Taylor. Unfortunately, Gregory was isolated in his late years, and his work did not gain much recognition. Curiously, although the arctangent series was known to Gregory since 1670 he did not think to plug $1$ into it and get an infinite sum for $\pi/4$. Leibniz thought of it several years later, after rederiving the expansion, it was his first major mathematical work. See Roy's Discovery of the Series formula for $\pi$ by Leibniz, Gregory and Nilakantha.