What happens if I receive bitcoins when my computer or smartphone is not online or powered off?
This works fine.
The bitcoins will appear next time I start my wallet application. (Read tuxcanfly answer)
Bitcoins are not actually received by the software (wallet) on my computer, they are appended to a public ledger that is shared between all the devices on the Bitcoin network. (Read SPRBRN comment)
If someone sent bitcoins when my wallet client program is not running and I launch it later, it will download all blocks and catch up with any transactions it did not already know about, and the bitcoins will eventually appear as if they were just received in real time.
My wallet is only needed when I wish to spend bitcoins!
Money (BTC transaction) is being send from one wallet to another,
that is being recorded in a book (public ledger),
which is written by many people (miners) and
kept securely by other people (BTC nodes)
Once written in the Book, it is never changed
When you open your wallet next time, what it does is, it simply checks this book, and reports to you how much balance you have, with an update if you received a new transaction between the last time you opened the book and now.
I hope this answers your query.