Let L be a line bundle on a smooth affine variety X (say, over complex numbers). Is it true that L always admits a FLAT algebraic connection?
No, any line bundle with a flat connection has a trivial rational Chern class. Now, take any smooth connected projective variety $X$ for which the Chern classes of line bundles form a group of rank $r$ larger than $1$. Removing an irreducible ample divisor $D$ from $X$ gives a smooth affine variety for which the Chern classes form a group of rank $r-1$. A specific example is $\mathbb P^1\times\mathbb P^1$ but there are lots of others of any dimension $>1$.