It is easy to calculate the coordinates of a regular polygon in the $X$-$Y$ plane. For a $N$ sided polygon with radius $r$. You get the $x$,$y$ and $z$ coordinates with:
$x = r*\cos(2 \pi \frac{n}{N})$ and
$y = r*\sin(2 \pi \frac{n}{N})$
$z = 0$
Let's assume I have a plane $P$ defined by its normal vector $\vec n$ and a point $p$. Therefore $P$ defined by all x that solve $(\vec x - \vec p)\vec n = 0$
If I want to have the $N$ sided polygon with center at the point "p" I need to transform the $X$-$Y$ plane to the plane defined by its normal vector.
It is propably the best to transform the center of the original polygon $(0,0,0)$ to the new center $p$.
An affine transformation looks like $f(\vec x) = A*\vec x + \vec t$. In this case $\vec t = \vec p$. But how do I get the transformation matrix $A$?
The transformation is not fully defined by what you've given. You have an $N$-gon in the plane centered at $p$, but you don't have anything that specifies how the $N$-gon is oriented in that plane. So, there is a continuum of transformations that will do the job.
This is why you are having trouble figuring it out. There isn't enough information to solve the problem without making some arbitrary choices. So, let's make an arbitrary choice, and then move on with that choice.
Pick an arbitrary point $\vec q \ne \vec p$ on $P$ and set $$\hat x = \frac {\vec q - \vec p}{\|\vec q - \vec p\|}$$ This unit vector will be our choice for the direction of "positive x-axis" in $P$. Define $\hat y = \vec n \times \hat x$. Then since $\hat y$ is also perpendicular $\vec n$, it points along $P$ as well, and is perpendicular to $\hat x$, and can serve as the positive y-axis direction in $P$.
Now we just define $A$ to carry $\hat i$ to $\hat x$, $\hat j$ to $\hat y$ and $\hat k$ to $\vec n$. $$A = \begin{bmatrix} \hat x & \hat y & \hat n\end{bmatrix}$$ (That is, the first column of $A$ is $\hat x$, etc.)