Preheat oven to 350°.
In a large saucepan, melt butter over low heat.
Stir in flour, salt, and pepper until smooth.
Gradually add milk.
Bring to a boil; cook and stir 2 minutes or until thickened. Remove from heat.
Stir in cheese until melted.
Stir in bacon.
Add potatoes and onion.
Transfer to a greased 2-qt. baking dish. Cover and bake 1 hour.
Uncover; bake 30-40 minutes or until the potatoes are tender.