In this paper, we are concerned with periodic, quasi-periodic (q.p.) and almost periodic (a.p.) Optimal Control problems. After defining these problems and setting them in an abstract setting by using Abstract Harmonic Analysis, we give some structure results of the set of solutions, and study the relations between periodic and a.p. problems. We prove for instance that for an autonomous concave problem, the a.p. problem has a solution if and only if all problems (periodic with fixed or variable period, q.p. or a.p.) have a constant solution. After that, we give some first order necessary conditions (weak Pontryagin) in the space of Harmonic Synthesis and we also give in this space an existence result.