You might have heard the following. I am actually referring to the second meaning of Chern-Simons classes $\tilde p(\nabla^0,\nabla^1)\in\Omega^\bullet(M)$ satisfying $d\tilde p(\nabla^0,\nabla^1)=p((\nabla^1)^2)-p((\nabla^0)^2)$. They can of course be recovered from the classes you described.

Given a vector bundle $(V,\nabla^V)$ with connection over $M$, you get the Chern-Weil form $p(F)\in\Omega^\bullet(M)$ that you described. A lift to relative forms would be a pair $(p(F),\alpha)$ with $\alpha\in\Omega^\bullet(U)$ satisfying $d\alpha=p(F)|_U$ on a collar neighbourhood $U$ of $\partial M$. With $\alpha$, you could easily replace $p(F)$ by a cohomologous form with compact support.

To construct $\alpha$, you need more information than just $(V,\nabla^V)$ - you need an explicit reason for $p(V)$ to vanish on $U$. In this context, a plausible reason is the existence of another connection $\nabla'$ on $V|_U$ such that $F'=(\nabla')^2=0$. This could come from a trivialisation of $V|_U$, but there might be other possibilities. Now you get the relative term $\alpha=\tilde p(\nabla',\nabla^V|_U)$, and you can compute a characteristic number
$$\langle(p(F),\tilde p(\nabla',\nabla^V|_U)),[M,\partial M]\rangle
=\int_Mp(F)-\int_{\partial M}\tilde p(\nabla',\nabla^V|_U)\;.$$

For Gauss-Bonnet-Chern, you need a "reason" for the Euler class of $TM$ to be trivial in a neighbourhood of $\partial M$. This is given by the fact that $TM|_{\partial M}\cong T\partial M\oplus\underline{\mathbb R}$. But the Levi-Civita connection does not respect this decomposition unless $M$ has totally geodesic boundary. If it does not, then you use a Chern-Simons form for the Euler form as a correction term. In fact, this is also related to Mathai-Quillen currents, which can be used to reduce Gauss-Bonnet-Chern to Poincaré-Hopf.