A clarify on morphisms of affine varieties and on varieties I apologize in advance for making a similar question to my previous one; as they pointed out in the comments, the question was not too clear because I am not used to the notions of locally ringed space. I would eliminate it but there is already an answer, so it would not be correct. Here, to be sure of knowing what I'm talking about, I'll just consider ringed spaces of functions, like Gathmann's notes do for example.
Let $k$ be a field, and for any set $S$ denote by $\mathrm{map}(S,k)$ the $k$-algebra of set maps $S\to k$. A ringed space of $k$-valued maps is a pair $(X,O_X)$ of a topological space $X$ and a sheaf $O_X$ of $k$-algebras on $X$, such that: $O_X(U) \subset \mathrm{map}(U,k)$ for any $U\subset X$ open, and for $V\subset U$ open, the restriction $O_X(U)\to O_X(V)$ is the usual restriction of maps. A morphism $(X,O_X)\to (Y,O_Y)$ of ringed spaces of $k$-valued maps is just a continuous map $f \colon X\to Y$ such that, for any $W\subset Y$ open and any $h\in O_Y(W)$, holds  $h\circ f\in O_X(f^{-1}(W))$. Denote by $\mathrm{RS}_k$ this category of ringed spaces of $k$-valued maps.
Now, an affine variety over $k$ is a closed subspace of some $\mathbb{A}_k^n$ (with Zariski topology), with its sheaf of regular maps; so an affine variety over $k$ is an object of $\mathrm{RS}_k$, and the category $\mathrm{Aff}_k$ is the full subcategory of $\mathrm{RS}_k$ whose objects are the affine varieties over $k$. Let $k'$ be another field; if $X$ and $Y$ are affine varieties over $k$ and $k'$ respectively, how to define an arbitrary morphism $X\to Y$ in this setting? The notion of such a morphism requires a category containing $\mathrm{Aff}_k$ and $\mathrm{Aff}_{k'}$. E.g., if $k'\subset k$, one has a full inclusion $\mathrm{RS}_{k'}\subset\mathrm{RS}_{k}$, and I think that would make sense to define a morphism $X\to Y$ as one in $\mathrm{RS}_{k}$. But is there a category containing $\mathrm{Aff}_k$ and $\mathrm{Aff}_{k'}$ for any two $k$, $k'$? If yes, is it some $\mathrm{RS}_K$ for a field $K$? In general the tensor product of fields is not a field, but maybe if $k$, $k'$ have same characteristic $p$, then $k\otimes_{\mathbb{Z}_p}k'$ is always a field?
I have a question regarding (not affine) varieties also. A variety $(X,O_X)$ is an object of some $\mathrm{RS}_k$ by definition, admitting an open covering of $X$ such that, for any open $U\subset X$ of the covering, $(U,O_X|_U)$ is isomorphic in $\mathrm{RS}_k$ to an affine variety. However those in $\mathrm{Aff}_k$ are not the only affine varieties in $\mathrm{RS}_k$; e.g., also affine varieties over $k'\subset k$ are objects of $\mathrm{RS}_k$. Is there some convention on this?
 A: 
Let $k'$ be another field; if $X$ and $Y$ are affine varieties over $k$ and $k'$ respectively, how to define an arbitrary morphism $X\to Y$ in this setting?

This is a fine question but it doesn't really have anything to do with (locally) ringed spaces, and makes perfect sense using completely algebraic foundations, e.g. defining $\text{Aff}_k$ to be the opposite of the category of finitely generated integral domains over $k$ or similar.
$X$ and $Y$ are not objects in the same category and so there is no obvious way to talk about morphisms between them. However, if we have the additional data of a morphism $f : k \to k'$, then there is a base change functor $(-)_{k'} : \text{Aff}_k \to \text{Aff}_{k'}$ which in terms of $k$-algebras is given by the tensor product $(-) \otimes_k k'$, and then given $X \in \text{Aff}_k$ and $Y \in \text{Aff}_{k'}$ we can meaningfully ask for a morphism $X_{k'} \to Y$ in $\text{Aff}_{k'}$. More generally if we have the additional data of a third field $k''$ together with two morphisms $k \to k'', k' \to k''$ then we can base change both $X$ and $Y$ to $k''$.
Edit: There is a mild subtlety here; we actually need to work with affine schemes. The problem is that the base change of an affine variety can fail to be an affine variety, because the base change of an integral domain can fail to be an integral domain. The next paragraph gives a simple example.

In general the tensor product of fields is not a field, but maybe if $k$, $k'$ have same characteristic $p$, then $k\otimes_{\mathbb{Z}_p}k'$ is always a field?

No, e.g. the tensor product of $\mathbb{F}_{p^n}$ with itself is never a field if $n \ge 2$. It is a nice exercise to show more generally that if $L$ is a finite Galois extension of $K$ with Galois group $G$ then $L \otimes_K L \cong L^G$.

However those in $\mathrm{Aff}_k$ are not the only affine varieties in $\mathrm{RS}_k$; e.g., also affine varieties over $k'\subset k$ are objects of $\mathrm{RS}_k$. Is there some convention on this?

Answering this question involves clarifying a subtle conceptual point. It is not the case, strictly speaking, that affine varieties over $k' \subset k$ are objects of $\text{RS}_k$. What is true is that there is a functor $\text{Aff}_{k'} \to \text{RS}_k$, given by base change as above; however, this functor is not full, because base changing to $k$ causes more morphisms to exist. So it's misleading to think of the image of this functor as consisting of affine varieties over $k'$, because the morphisms are different (and so e.g. there can be varieties which are not isomorphic over $k'$ but which become isomorphic when base changed to $k$). What it consists of is affine varieties $X$ over $k$ which happen to be the base change of an affine variety $X'$ over $k'$; a choice of such an affine variety is called a $k'$-form of $X$, and it's a delicate and subtle question when they exist and how many there are when they do, involving what is called Galois descent.
A simple example here is to take $k' = \mathbb{R}, k = \mathbb{C}$ and consider the varieties
$$V = \{ x^2 + y^2 = -1 \}, W = \{ x^2 + y^2 = 1 \}$$
over $\mathbb{R}$. These varieties are not isomorphic over $\mathbb{R}$ because $V$ has no real points but $W$ does. However, after complexification (base change to $\mathbb{C}$) they become isomorphic because we can scale $x$ and $y$ by $i$. So $V$ and $W$ are two non-isomorphic real forms of the same complex variety, which turns out to be the punctured affine line $\mathbb{A}^1 \setminus \{ 0 \}$ (this is a nice exercise; the point is that over $\mathbb{C}$ we can write $x^2 + y^2 = (x + iy)(x - iy)$).
A: Question: "But is there a category containing $\mathrm{Aff}_k$ and $\mathrm{Aff}_{k'}$ for any two $k$, $k'$? If yes, is it some $\mathrm{RS}_K$ for a field $K$?"
Answer: If $k$ is not algebraically closed and if $X \subseteq \mathbb{P}^n_k$
is a projective scheme of finite type over $k$ with $U \subseteq X$ an open set, you cannot in general find one field $L$ and an embedding $i:\mathcal{O}_X(U) \subseteq Map(U,L)$ - you may not interpret the sections over $U$ as "functions" on $U$. If $U:=Spec(A)$ there is for every closed point  $x\in U$ a residue field $\kappa(x)$ which is a finite extension of $k$ and you may "evaluate" as section $s$ at $x$: There is a "value" $s(x) \in \kappa(x)$. The residue field $\kappa(x)$ changes with $x$, hence there is no fixed field $L$ and an embedding $i$.
If $k$ is algebraically closed there is for every $x$ a canonical isomorphism $k \cong \kappa(x)$ and you get a map $i_U: \mathcal{O}_X(U) \rightarrow Map(U^{cl},k)$ where $U^{cl}$ is the set of closed points in $U$, and if $i_U(s)=i_U(t)$ it follows $s-t$ is in the radical of $A$ which equals the nilradical $nil(A) \subseteq A$. If $A$ is reduced it follows $s=t$ and in this case $i_U$ is in jective.
I believe the following holds (you must check some details): There is a sheaf of rings on $X$, denoted $Map_k(-)$ defined by
$$Map_k(U):=Map(U^{cl}, k)$$
where $U \subseteq X$ is an open set and $U^{cl} \subseteq U$ the set of closed points. For any open subset $V \subseteq U$ there is an inclusion $V^{cl} \subseteq U^{cl}$ and it follows there is a canonical restriction map
$$r_{U,V}: Map_k(U) \rightarrow Map_k(V)$$
and $(Map_k(-), r)$ is a sheaf of rings (of $k$-algebras) on $X$ with a canonical map $i:\mathcal{O}_X \rightarrow Map_k(-)$ of sheaves of rings.
Lemma. If $X$ is reduced it follows the map $i_U$ is an injection for any open set $U$.
This follows essentially from the above argument since for any open affine subset $Spec(A)$ it follows $A$ is a reduced ring. Hence when $k$ is algebraically closed and $X$ is reduced there is a candidate for such a sheaf - namely $Map_k(-)$. In Hartshornes book chapter I he defines (he does not mention it explicitly) the structure sheaf using $Map_k(-)$ for a quasi projective algebraic variety $X$ over  $k$. In Hartshornes language a variety is integral hence reduced.
If not, it follows $s\neq t$ and $i_U(s-t)=0$, hence $i_U$ is not injective, and one of the main reasons for introducing "schemes" is this prescence of nilpotent elements in $\mathcal{O}_X(U)$. We need these nilpotent elements in order to study phenomena such as multiplicities, tangents, differential operators etc. In real analysis one is interested in the "value" of a function at a point $x$ and in an open subset $U$ containing $x$. In algebraic geometry one is interested in the zeros of $s$ and the properties of the zeros. It does not make sense to "maximise" a section "s" when the base field has characteristic $p>0$.
Question: "I have a question regarding (not affine) varieties also. A variety $(X, O_X)$ is an object of some $\mathrm{RS}_k$ by definition, admitting an open covering of $X$ such that, for any open $U \subset X$ of the covering, $(U, O_X|_U)$ is isomorphic in $\mathrm{RS}_k$ to an affine variety. However those in $\mathrm{Aff}_k$ are not the only affine varieties in $\mathrm{RS}_k$; e.g., also affine varieties over $k' \subset k$ are objects of $\mathrm{RS}_k$. Is there some convention on this?"
Answer: Before speaking about categories you should study Chapter I in Hartshorne, in particular the chapters on regular maps and morphisms. Once you have understood what an algebraic variety is you can start to worry about category theory. The category theory is more of a "framework" and you seldom use it to prove results.
Question: "But is there a category containing $\mathrm{Aff}_k$ and $\mathrm{Aff}_{k'}$ for any two $k$, $k'$? If yes, is it some $\mathrm{RS}_K$ for a field $K$? In general the tensor product of fields is not a field, but maybe if $k$, $k'$ have same characteristic $p$, then $k\otimes_{\mathbb{Z}_p}k'$ is always a field?"
Answer: If there is an inclusion of fields $k \subseteq L$ there is for any $k$-algebra $A$ and any $L$-algebra $R$ an equality of sets (called "Frobenius reciprocity")
$$Hom_{k-alg}(A,R) \cong Hom_{L-alg}(L\otimes_k A, R).$$
If $X:=Spec(R), Y:=Spec(A), S:=Spec(k), T:=Spec(L)$ you get an equality
$$Hom_{Sch/k}(X,Y) \cong Hom_{Sch/L}(X, T\times_S Y)$$
hence a map (of affine schemes over $L$) $f:X \rightarrow T\times_S Y$ is uniquely determined by a map $g: X \rightarrow Y$ defined over $k$.  This makes sense whenever you have a field extension $k \subseteq L$. If you do not have a field extension there are no such maps.
