The trick is to walk briskly to Immigration. You should be OK if you do that. The express train services (JR & Keisei) stop around the same time. It's 30 seconds from the Customs exit to the bus ticket counter, and 30 seconds from the counter to the bus stop. Anything bright orange is bus-related.
Although the last Keisei Skyliner is 22:00, there's a Local at 22:15 and a Limited Express at 22:41. You'd change at Nippori to the Loop Line, or Ueno and grab a cab, depending on your baggage I guess.
Last Narita Express (on JR) is 21:43, so that's no help.
The last two options are to stay at the airport overnight, or get a taxi. Taxis are fixed price into the city.
If you have a suitcase, it can free you up a bit if you have a delivery service get it to your hotel the next morning. It's really cheap.
But I think you'll be fine.