$f:X \rightarrow Y$. What are the conditions on $f$,$X$,$Y$ in order for an integral of $f$ to be defined? Let's assume $X,Y$ are arbitrary sets, and $f$ is a function between them. What must those sets, and $f$, satisfy, in order for us to be able to define an integral of $f$ in a way that "makes sense"?
 A: First of all, the question is not "what conditions must $X$ and $Y$ satisfy" but "what structures must $X$ and $Y$ have?"  Second of all, there is not one most general definition of the integral; depending on what you consider an "integral," there are several definitions which generalize in different directions.
Probably the most basic requirement is that the integral is a linear operator.  For this to make sense, as Akhil says, $Y$ needs some kind of linear structure.  If $Y$ is an abelian group and $X$ a finite set, then a perfectly sensible definition of the integral of $f$ is $ \sum_{x \in X} f(x)$, which is in fact a linear operator from the abelian group of functions $X \to Y$ to $Y$ (in fact the unique one, up to scaling, which is invariant under the symmetry group of $X$).  But of course the finite case is not very interesting.  (Note that in order for the sum to make sense above without an ordering on $X$ it is necessary that $Y$ be abelian.)  More generally one can stipulate that the only "integrable functions" are the finitely supported ones, in which case this definition always makes sense.  But again, a pretty boring definition.
In the infinite case, for example if $X = \mathbb{N}$, we would like to define the integral as some kind of limit, for example maybe $\lim_{n \to \infty}  \sum_{k=1}^{n} f(k)$, because we would intuitively like to "sum over $X$" (but can't, at least not directly).  For this to make sense $Y$ needs a notion of convergence and $f$ needs to satisfy a "smallness" condition.  At a bare minimum, then, it needs to be a topological abelian group (say complete with respect to a norm), but there are some additional technicalities and I think they are usually resolved by requiring that $Y$ is a Banach space over a complete field.
Another feature of the infinite case is that, if indicator functions of "small" subsets of $X$ are to be integrable, then a notion of integral on functions out of $X$ implies a notion of "size" or measure on $X$.  The usual way people handle this is to require that $X$ be a measure space, in which case (together with the structures on $Y$ described above) the usual construction of the Lebesgue integral goes through.
A: In Stefan Rolewicz book Metric Linear Spaces there are different kinds of general and useful results regarding integration on "more abstract spaces". 
For example  $f:[0,1]\to X$ where $X$ is an $F$-space, he discuss the Riemann-integral and if, in addition, $X$ is locally convex then the Bochner-Lebesgue integral is more fruitful.
However, though I like your question I believe that in the end I think it is better to have some application in mind and then, whenever needed, try to look for some integration methods for the situation. Sometimes it is good to be open to alternative methods in other areas of mathematics that might be more handy, for example "abstract maximum principles". 
