How far can the National Debt go before China and other countries decide to stop lending us money?

The National Debt is currently at 12.5 trillion dollars, and rising by the second. Now, it doesn’t look like that money will be paid off anytime soon. It is the result of years of massive military and social spending, predominantly. Under Reagan, the National Debt rose substantially due to the ridiculous military buildup that the government oversaw, along with massive overall government expansion, and during his presidency, the US went from being the largest creditor nation on earth to the largest debtor nation. So my question is how do we take care of this problem?