speaking of the past:
"Ich war mal in China"
here it's a shortened form of "einmal".
-> I've been to China once.
speaking of the future:
"Ich würde gern mal nach China"
same here, in English I'd say:
-> I'd like to go to China someday
asking for something:
the word "mal" makes it sound extra casual and implies that it's just a short task you're asking the other one to do.
"kannst du hier mal mit herlangen?"
roughly: can you lend me a hand here?
"kannst du das mal halten?"
can you hold this for a second?
"kann ich mal deinen Stift haben?"
can I borrow your pen for a very short time? (like for subscribing a document)