In theoretical physics it is quite common to talk about the number of compact and non-compact dimensions of a manifold, or even about compactified dimensions, and indeed often it is quite clear what is meant, like in a Cartesian product of a compact manifold with $\mathbb{R}^k$. Can this actually be defined in somewhat general terms?
As a first step, maybe we can say that the compact dimension is the maximal $k$ so that $M$ can be written as a product $K\times V$ where $K$ is a compact $k$-manifold, or locally so, as in a fiber bundle with base space either $K$ or $V$.
Is it possible for a general $n$-manifold (or a general differentiable manifold) to say how many compact and how many non-compact dimensions it has?
I would also be very interested in any example where it is not immediately clear how many dimensions we'd like to call compact and how many non-compact.
EDIT It may make sense to add some more restrictions, like completeness for a (pseudo)-Riemannian metric. If not, a once-punctured sphere would probably have to be considered as having no compact dimensions, and a twice punctured sphere as having $n-1$ compact dimensions.
Here's a quick critique of the "first step" proposal in your question. The problem with that proposal is that not every manifold $M$ can be written in any of the forms suggested. As a counterexample, consider simply the sphere minus 3 points, i.e. $M = S^2 - \{p,q,r\}$ where $p,q,r$ are three distinct points in $S^2$.
In that counterexample, and in many other low dimensional situations, sometimes topologists use a "compact core" of the manifold $M$, which is a compact subset $K \subset M$ for which there exists a deformation retraction $M \to K$. For example, $M=S^2 - \{p,q,r\}$ has a compact core consisting of a finite embedded graph $K \subset M$ having two vertices $x,y$ and three edges each having one endoint at $x$ and the other at $y$, such that each component of $M-K$ is an annulus. One theorem of topology is that if $M$ is a connected manifold of dimension $2$ (easy) or $3$ (quite a bit harder) then $M$ has a compact core. However, this core is rarely a closed manifold of lower dimension (by "closed" I mean compact with empty boundary), nor is it a Cartesian factor nor a fiber nor base of some fibration of $M$.
What's worse, there are examples for which no compact core exists. Let $C \subset S^2$ be an embedding of the Cantor set; for instance, take the standard middle thirds Cantor set in $[0,1]$, include into $\mathbb{R}$, include into $\mathbb{R}^2$, then take the one point compactification. The manifold $S^2 - C$ has no compact core. The best I could say for this example, in the language of your question, is that all 2 of the dimensions are noncompact dimensions.