At the price of being too categorical for the question, one can follow up Todd's answer as follows.
Consider any closed symmetric monoidal category $\mathcal{V}$ with product $\otimes$ and unit object $k$, such as vector spaces over a field $k$. Let $V$ be an object of $\mathcal{V}$ and let $DV = Hom(V,k)$.  Just from formal properties of $\mathcal{V}$, there are canonical maps $\iota\colon k\to Hom(V,V)$ and $\nu\colon DV\otimes V\to Hom(V,V)$, which are the usual things for vector spaces.  Say that $V$ is dualizable if there is a map  $\eta\colon k\to V\otimes DV$ such that $\nu \circ \gamma \circ \eta = \iota$, where $\gamma$ is the commutativity isomorphism.  Formal arguments show that $\nu$ is then an isomorphism and if $\epsilon\colon DV\otimes V \to k$ is the evaluation map (there formally), then, with $W=DV$, $\eta$ and $\epsilon$ satisfy the conditions Todd stated for $e$ and $f$.  This is general enough that it can't have anything to do
with bases.  But restricting to vector spaces, we can choose a finite set of elements $f_i\in DV$
and $e_i\in V$ such that $\nu(\sum f_i\otimes e_i) = id$.  Then it is formal that $\{e_i\}$ is 
a basis for $V$ with dual basis $\{f_i\}$.  This proves that $V$ is finite dimensional, and the 
converse is clear as in Todd's answer. There is a result in Cartan-Eilenberg called the dual basis theorem that essentially points out that the precisely analogous characterization holds for finitely generated projective modules over a commutative ring $k$, with the same proof.