We can prove the following result:
$$\dim(X\to \mathbb F)=\begin{cases} X,&\text{if }X\text{ is finite}, \\ |X \to\mathbb F|,&\text{otherwise}.\end{cases}$$
Our proof makes heavy use of the following lemma.
Let $Y$ be some set with a distinguished $0$ element. Let $X \to_0 Y$ represent the set of finitely supported functions $X \to \mathbb F$. Suppose that either $X$ is infinite with $|Y| \ge 2$, or $Y$ is infinite with $|X| \ge 1$. Then $$|X \to_0 Y| = |X \times Y| = \max\{|X|, |Y|\}.$$
Proving the $\ge$ inequality is simple enough, as there are $|X \times Y|$ functions that send an element of $X$ to a nonzero element of $Y$, and all others to $0$.
For the other direction, we introduce more notation. Let $\mathcal P_0(S)$ be the set of finite subsets of $S$. Consider the "graph" function $G : (X\to_0 Y)\to \mathcal P_0(X\times Y)$ given by $$G(f) = \{(x, f(x)):x \in X,\ f(x) \ne 0\}.$$ This is an injection. It then suffices to note that if $S$ is some infinite set, then $$|S| \le |\mathcal P_0(S)| \le \sum_{n\in\mathbb N} |S^n| = 1 + \aleph_0 \times |S| = |S|.$$ Thus $|X \to_0 Y| \le |\mathcal P_0(X\times Y)| = |X \times Y|$ as desired.
We'll also use the following corollary.
Let $S \subseteq \mathbb F$. Let $\mathbb G$ be the subfield of $\mathbb F$ generated by $S$. Then $$|\mathbb G| \le \max \{|S|, \aleph_0\}.$$
To prove this, let $\mathbb F'$ be the prime field of $\mathbb F$, which is countable. Let $X$ be a set of $|S|$ indeterminate symbols. Evaluation at $S$ gives us a function $\mathbb F'[X] \to \mathbb G$. Let $\mathbb H$ be its image, which is a subring of $\mathbb G$. By considering the degrees of each monomial term and their coefficients, $\mathbb F'[X]$ is in bijection with $(S \to_0 \mathbb N) \to_0 \mathbb F'$. By our previous lemma, this set has cardinality $\max \{|S|, \aleph_0\}$, and $|\mathbb H|$ is less or equal to this.
Finally, note that $\mathbb G$ is isomorphic to the field of fractions of $\mathbb H$. If $\mathbb H$ is finite, then so is $\mathbb G$. Otherwise $$|\mathbb H| \le |\mathbb G| \le |\mathbb H^2| = |\mathbb H|$$ and our corollary follows.
Back to our main result. The case where $X$ is finite is standard. We divide the second case into two: when $|X \to\mathbb F|$ is equal to, or strictly larger than $|\mathbb F|$.
If $|X \to \mathbb F| > |\mathbb F|$, we consider an infinite linearly independent set $\mathcal B$. Its span is in bijection with $\mathcal B \to_0 \mathbb F$, and by our lemma, it has cardinality $\max \{|\mathcal B|,|\mathbb F|\}$. For $\mathcal B$ to be a basis, we must thus have $|\mathcal B| = |X \to \mathbb F|$. Of course, a basis (or any subset) can't be any larger, so this shows that the space has the desired cardinality.
Now suppose $|X \to \mathbb F| = |\mathbb F|$. By Cantor's theorem, $|X| < |\mathbb F|$, and in particular $\aleph_0 < |\mathbb F|$. Let $\mathcal B$ be a basis. Clearly $|\mathcal B| \le |\mathbb F|$, so we just need to show that $|\mathcal B|<|\mathbb F|$ leads to a contradiction. Define $$S = \{f(x): f \in \mathcal B,\ x\in X\}.$$ Let $\mathbb G$ be the field generated by $S$, so that $\mathcal B$ is a subset of $X \to \mathbb G$. By our corollary, $$|\mathbb G| \le \max\{|S|, \aleph_0\} \le \max\{|B|, |X|, \aleph_0\} < |\mathbb F|.$$ In particular, $\mathbb F$ is an infinite-dimensional vector space over $\mathbb G$.
Let $\{x_i\} _ {i\in\mathbb N}$ be an infinite subset of $X$, and let $\{e_i\} _ {i\in\mathbb N}$ be an infinite $\mathbb G$-linearly independent subset of $\mathbb F$. Let $f: X\to \mathbb F$ be a function such that $f(x_i) = e_i$ for all $i\in\mathbb N$. Since $\mathcal B$ is a basis, there must exist some $a_0, \ldots, a_n\in \mathbb F$ and $g_0, \ldots, g_n : X \to\mathbb G$ such that $$\sum_{j=0}^n a_jg_j = f.$$ Evaluating both sides at any $x_i$, we find that all $e_i$ are $\mathbb G$-linear combinations of $a_0,\ldots, a_n$. This contradicts that they're an infinite linearly independent set, and our result is proven.