This is formalized by saying that a spacetime is a smooth Lorentzian space$(X,\mu)$ equipped with a time orientation (see there).

In the context of classical general relativity a spacetime is usually in addition assumed to be connected and four-dimensional. A connected Lorentzian manifold is either time orientable or it has a two-sheeted covering which is time orientable.

The noun “spacetime” is used in both special relativity and general relativity, but is best motivated from the viewpoint of general relativity. Special relativity deals with the Minkowski spacetime only. The Minkowski spacetime allows a canonical choice of global coordinates such that the metric tensor has in every point the form diag(-1, 1, 1, 1), which identifies the first coordinate as representing the time coordinate and the others as representing space coordinates.

Given a general spacetime, there is not necessarily a globally defined coordinate system, and therefore not necessarily a globally defined canonical time coordinate. More specifically, there are spacetimes that admit coordinates defined on subsets where the physical interpretation of the coordinates as modelling time and space coordinates changes over the domain of definition.