How to keep a conversation going (with a stranger, on an app, over text)
The short version: To keep a conversation going, ask a follow-up about the thing they just said, in their words, and share one true thing about yourself for every two questions. Open questions beat yes or no questions, whether you are talking to a stranger, on an app, or over text.
Most conversations die for one of two reasons. You asked a question with a one-word answer, or you got an answer and replied with a fact about yourself instead of a question about theirs. Fix those two habits and you can talk to almost anyone for twenty minutes.
The follow-up rule

Ask about the thing they said, in their words. If they say they spent the weekend fixing a bike, the next line is about the bike. Not your bike. Theirs. "What was wrong with it?" "Did it work?" "Is this a bike you ride or a bike you own?"
People like to be asked about the thing they chose to mention. They mentioned it for a reason. Follow it two or three steps and you will land on something they care about, and that is where conversations stop needing effort.
With a stranger
You have no history to draw on, so use the room. The line, the weather, the thing you are both waiting for. Observations beat questions at the start because they do not demand anything. "This line has not moved in ten minutes" invites a reply without requiring one.
Once they reply, switch to questions. Open ones. "Where are you headed after this?" gives them a sentence. "Are you from here?" gives them a syllable.
Say one true thing about yourself for every two questions you ask. A conversation that is all questions feels like a form, and a conversation that is all you feels like a podcast.
On a dating app
The chat window makes everything feel high stakes, because you are performing for a stranger with a scroll of other strangers below you. Lower the stakes on purpose.
Reply to the specific thing in their profile or their last message. "Your dog looks like he runs the house" opens more doors than "hey." Ask one question per message. Two questions is a quiz. Keep each message about the length of theirs.
When the chat stalls, you do not need a new topic. Go back to something they said two messages ago. "Wait, you said you lived in Denver. For how long?" The other person is relieved; they thought the conversation was over too.
If you have traded ten messages and it is going well, suggest talking. A phone call or a voice note moves things faster than another week of typing, because you can hear whether the jokes land.
Over text

Text has no tone, so give it some. Short replies read as cold even when you meant them as busy. Add a second sentence. "Good, you?" ends a conversation. "Good. Made it through Monday with one coffee and one meeting I did not need. You?" keeps it going.
Match their pace. If they reply in an hour, you reply in an hour, give or take. Firing back in nine seconds every time makes the other person feel like they owe you something.
Pictures are a cheat code. A photo of the thing you are talking about ("the bike, before and after") gives the other person something to react to without having to invent a reply.
What to text after meeting someone

Send something the same day or the next morning. Mention one specific moment from the meeting, then ask a small question that points at the future. "I'm still thinking about your take on pineapple pizza. Are you free Thursday to defend it in person?"
Skip "it was nice meeting you." It is true, and it is also what you would text someone you never want to see again.
When to let it end
Conversations have a natural length. If you have both run out of follow-ups and the replies are getting shorter, end it on a high note instead of dragging it. "I have to run, but this was fun. Same time Thursday?" The second conversation is easier than the first, and ending the first one well is how you get a second.
The part nobody tells you
The reason you run out of things to say over text is that text gives you nothing to react to. No face, no tone, no pause. In a voice conversation you react to each other and the material makes itself.
Kream & Sugar runs on that idea. In a café round you and a few other people meet as avatars, with your real voices, and the round gives you quests to complete. The quests give you the opening. The other people's answers give you the follow-ups. The round ends on a timer, so the awkward "well, anyway" moment never arrives. People who clicked can send a match request afterward, and you take it from there.
FAQ
How do I keep a conversation going when they give short answers?
Ask about the one specific thing in their short answer. If "fine" is all you get twice in a row, say something true about your own day and give them something to react to. If it stays at "fine," let it end. Short answers are an answer.
How do I keep a conversation going with a guy, or with a girl?
The same way. Follow what they said, ask open questions, and give back one true thing for every two questions. The gender of the person changes less than the habit of listening.
What do I text after a first date?
One specific moment from the date and one small question about the next one. Same day or next morning.