Here is a sketch of an answer. It is in two parts. The first part is how I got to the answer; the second part is the sketch. You can just skip to the second part if you want, but the first part might be helpful for conveying intuition.
First part: The basic fact I always remember is that a $\mathbb G_m$-action on a vector space corresponds to a $\mathbb Z$-grading, in which the $n$th graded piece is the eigenspace where $\mathbb G_m$ acts through the character $t \mapsto t^n$.)
The relationship between $\mathbb G_m$ and $\mathbb Z$ is that the Hopf algebra $k(\mathbb Z)$ (as in your question) is dual to the Hopf algebra of affine functions on $\mathbb G_m$.
So my first step was to imagine that $G = \mathbb Z$, and to try to get a $\mathbb G_m$-action into the picture, from which I can then find a $\mathbb Z$-grading. For this, I need to pass to a dual.
In fact I don't need to suppose that $G = \mathbb Z$ for what I will do. More generally, I suppose that there is a commutative affine algebraic group $G^{\vee}$ so that $k(G)$ is the dual Hopf algebra to the affine ring $k[G^{\vee}].$
(This imposes the condition that $G$ be abelian. If $G$ is finite then $G^{\vee}$ is the Cartier dual of $G$, thought of as a finite etale group scheme. If $G = \mathbb Z$ then $G^{\vee} = \mathbb G_m$.)
I furthermore suppose that the module structure $k(G) \otimes A \to A$ arises as the dual of a map $A \to k[G^{\vee}] \otimes A.$ The "algebra" condition on the module structure then corresponds to requiring that this map is a homomorphism of $k$-algebras.
(If $G$ is finite abelian, then $k[G^{\vee}] = k(G)^{\vee}$ by double-duality for finite dimensional $k$-vector spaces, and so any map $k(G) \otimes A \to A$ arises by dualizing a map $A \to k[G^{\vee}]\otimes A$. If $G$ is infinite double-duality fails, and I'm not sure how special this assumption is. Since it is ulimately only being used for intuition, let's not worry too much about it!)
Let's suppose now that $A$ is commutative, so that $k(G)^{\vee}$ is the ring of functions on an algebraic group $G^{\vee}$ (the Cartier dual to the discrete group $G$ if $G$ is finite abelian, or $\mathbb G_m$ if $G = \mathbb Z$; in the latter case you should take into account the preceding parenthetical remark).
Then the morphism $A \otimes k[G^{\vee}] \otimes A$ corresponds to a morphism $G^{\vee} \times \text{ Spec} \, A \to \text{ Spec} \, A,$ which is in fact an action of $G^{\vee}$ on Spec $A$. (The fact that we get an action uses the fact that the morphism $k(G) \otimes A \to A$ arising from $A \otimes k[G^{\vee}] \to A$ is assumed to induce a module structure on $A$.)
Now a $G^{\vee}$ action on Spec $A$ gives a $G^{\vee}$-action on $A$ (the ring of globally defind functions on Spec $A$), which gives a $G$-grading on $A$.
(See the discussion of the $\mathbb G_m$ case above.)
Second part: Now one can unwind the discussion of the first part, and describe the $G$-grading on $A$ directly in terms of the given map $k(G) \otimes A \to A$. Namely if $g \in G$ then evaluation at $g$ gives a homomorphism $k(G) \to k$; denote it $\chi_g$. Then (chasing through everything) one finds that $A_g$ is the $\chi(g)$-eigenspace of $A$ for the given $k(G)$-module space, i.e. it is the subspace of elements of $A$ on which each $f \in k(G)$ acts as multiplication by the scalar $f(g)$.
Now you should be able to prove directly that this gives a $G$-grading on $A$, perhaps with some additional assumptions: e.g. if $A$ is finite-dimensional and $k$ is of char. zero, then I think you should be able to argue that $A$ decomposes as a direct sum of such eigenspaces (this just uses the module structure), and then the "algebra" assumption shows that this decomposition is compatible with the multiplication on $A$.