The length depends on the current maximum t.co length, which you can retrieve from the help/configuraiton method.
Currently it’s 22 characters for a HTTP URL and 23 for a HTTPS URL. So in your examples, everywhere you have put a HTTP URL, count 22 characters, and everywhere a HTTPS URL, count 23.
If a tweet has no URLs or URL-like constructs, you can use 140 characters. If a tweet has one HTTP URL, you can use 118 characters (don’t forget a space though…). If a tweet has one HTTPS URL, you can use 117 characters. If it has two URLs, one HTTP and the other HTTPS, then you’ll have 94 more characters to work with (I’m including an obligatory space character in that calculation).