A second season episode of The Next Generation I watched the other day had Cdr. Riker turning down an offer to command his own ship. I seem to remember other offers being rebuffed by Riker, though he ultimately accepts one in his last on-screen appearance in Star Trek: Nemesis.
First, the ACTUAL commands:
2366 : Temporary field promotion to captain by Adm. Hanson during Borg crisis
By 2379, Riker decided to accept promotion to captain of the USS Titan. The Titan was dispatched to the Romulan Neutral Zone to serve as the command ship for a diplomatic task force. ("Star Trek Nemesis")
[NOTE: This bullet is from fanfic-level Memory Gamma, so not part of any canon or official info ] In 2385, Riker accepted a promotion to the rank of Rear Admiral (lower grade) and reluctantly turned over command of the USS Titan to his Executive Officer, Commander Christine Vale, assuming command of the new Yamato-class Heavy Battleship USS Paladin and Task Force Paladin despite not wanting to leave the Titan yet.
Next, command offers (from http://memory-alpha.org/wiki/William_T._Riker#Command_offers)
Riker was offered several commands during his tenure aboard the Enterprise. Including:
- the aforementioned USS Drake,
he was offered the USS Aries in 2365
The Aries command was offered to Riker because of his exceptional abilities as a scientist. He turned down the Aries posting because he felt he was not yet ready to leave the Enterprise and the distinction that the first officer post held. (TNG: "The Icarus Factor")
the USS Melbourne in 2366. (TNG: "The Best of Both Worlds")
Starfleet put a great amount of pressure on Riker to accept command of the Melbourne. Many admirals and even Captain Picard felt that he had remained too long on board the Enterprise and should have accepted a command by that point in his career, lest it seem like he was standing still in a sea of upstart officers like Shelby. Even Riker questioned why he remained as Enterprise first officer, and was unable to understand what kept him from leaving. (TNG: "The Best of Both Worlds")
"She's a fine ship, Will." "Yes, but she's not the Enterprise." Picard and Riker (about the Melbourne)
Q said in Voyager:"Death Wish" that he "was betting Riker" would have taken command of the USS Voyager, which may mean he was also offered command of that ship before Captain Janeway.
SUMMARY: At least 3 and possibly four turned down promotions
1) USS Drake: NCC 70956 (Andromeda Class).
2) USS Aries: NCC 45167 (Renaissance Class).
3) USS Melbourne NCC 62043 (Excelsior Class).
1) USS Enterprise: NCC1701/D (Galaxy Class). (Returned Command of the Ship to Captain Jean-Luc Picard).
2) USS Titan: NCC 80102 (Lunar Class). (Current Assignment).
Possible Rejected Commissions:
1) USS Voyager NCC 74656 (Intrepid Class)
In the episode "Death Wish" in "Star Trek, "Voyager"", Q commented To Captain Kathryn Janeway, that he was, "Betting Riker would get this Command". Ergo, it is possible that William Thomas Riker was offered that Ship! However, this is pure speculation!
I'm not going to repeat what have been already well covered in the previous answers, but there is another likely command rejection that does not appear to be covered in canon (at least on screen, I can't confirm whether this is covered in any of the books).
But to expand on Riker's promotion during the original Borg crisis. He was promoted to Captain and given command of the Enterprise. This occurs after he passed on command of the Melbourne (and the Melbourne is destroyed shortly thereafter during the Battle of Wolf 359).
After Captain Picard's rescue and after Picard was restored his position as captain of the Enterprise, you have the following exchange between Shelby and Captain Riker.
SHELBY: We'll have the fleet back up in less than a year. I imagine you'll get your choice of any Starfleet command, sir.
RIKER: Everyone is so concerned about my next job. With all due respect, Commander, sir, my career plans are my own business, and no one else's. But it's nice to know I'll have a few options.
The next time we see Riker, he is a Commander and is again the First Officer of the Enterprise.
Based on Shelby's statements, we can guess that he was offered a command during this period between Best of Both Worlds Pt 2 and Family, and since he was back at his old posting, we can also surmise that he turned down that command and elected to remain on the Enterprise.